gcc/gcc/config/sh/sh.c

13578 lines
399 KiB
C
Raw Normal View History

/* Output routines for GCC for Renesas / SuperH SH.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com).
Improved by Jim Wilson (wilson@cygnus.com).
1993-04-30 16:29:19 +02:00
2003-09-27 06:48:30 +02:00
This file is part of GCC.
1995-06-15 22:46:00 +02:00
2003-09-27 06:48:30 +02:00
GCC is free software; you can redistribute it and/or modify
1995-06-15 22:46:00 +02: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)
1995-06-15 22:46:00 +02:00
any later version.
2003-09-27 06:48:30 +02:00
GCC is distributed in the hope that it will be useful,
1995-06-15 22:46:00 +02: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/>. */
1993-04-30 16:29:19 +02:00
/* FIXME: This is a temporary hack, so that we can include <algorithm>
below. <algorithm> will try to include <cstdlib> which will reference
malloc & co, which are poisoned by "system.h". The proper solution is
to include <cstdlib> in "system.h" instead of <stdlib.h>. */
#include <cstdlib>
1993-04-30 16:29:19 +02:00
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "insn-config.h"
1993-04-30 16:29:19 +02:00
#include "rtl.h"
#include "tree.h"
#include "flags.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"
#include "reload.h"
#include "function.h"
1995-04-21 03:19:27 +02:00
#include "regs.h"
#include "hard-reg-set.h"
#include "output.h"
#include "insn-attr.h"
toplev.h: Do not include diagnostic-core.h. 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org> * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. From-SVN: r161943
2010-07-08 06:22:54 +02:00
#include "diagnostic-core.h"
#include "recog.h"
#include "dwarf2.h"
#include "tm_p.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"
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
#include "langhooks.h"
#include "basic-block.h"
#include "df.h"
#include "intl.h"
#include "sched-int.h"
#include "params.h"
#include "ggc.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"
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
#include "cfgloop.h"
#include "alloc-pool.h"
constraints.md: New file. * config/sh/constraints.md: New file. * config/sh/sh.c: Include tm-constrs.h. (reg_class_from_letter): Remove. (prepare_cbranch_operands): Use satisfies_constraint_* function instead of macro. (andcosts, broken_move, sh_secondary_reload): Likewise. * config/sh/predicates.md (trapping_target_operand): Likewise. (and_operand, arith_operand, arith_reg_or_0_operand, cmp_operand, logical_operand, target_operand, ua_address_operand, ua_offset, xor_operand): Likewise. * config/sh/sh.md: Include constraints.md. (*movsicc_t_false): Use satisfies_constraint_* function instead of macro. (*movsicc_t_true, ashlsi3_std, ashlhi3_k, lshrsi3_m, lshrsi3_k, movsi_const_16bit+2, *movhi_media+1, movdi_const_16bit+1, beq, bne, *ptb): Likewise. * config/sh/sh.h (reg_class_from_letter): Remove prototype. (OVERRIDE_OPTIONS): Don't modify reg_class_from_letter. (REG_CLASS_FROM_CONSTRAINT): Remove. (CONSTRAINT_LEN, CONST_OK_FOR_I20, CONST_OK_FOR_I, CONST_OK_FOR_J, CONST_OK_FOR_K16, CONST_OK_FOR_K, CONST_OK_FOR_P27, CONST_OK_FOR_P, CONST_OK_FOR_M, CONST_OK_FOR_N, CONST_OK_FOR_CONSTRAINT_P, CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. (SECONDARY_INOUT_RELOAD_CLASS): Use satisfies_constraint_* function instead of macro. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (EXTRA_CONSTRAINT_Q, EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc, EXTRA_CONSTRAINT_B, EXTRA_CONSTRAINT_Css, EXTRA_CONSTRAINT_Csu): Remove. (IS_PC_RELATIVE_LOAD_ADDR_P): New macro. (IS_LITERAL_OR_SYMBOLIC_S16_P): Likewise. (IS_LITERAL_OR_SYMBOLIC_U16_P): Likewise. (IS_NON_EXPLICIT_CONSTANT_P): Likewise. (EXTRA_CONSTRAINT_Csy, EXTRA_CONSTRAINT_Z, EXTRA_CONSTRAINT_W, EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C, EXTRA_MEMORY_CONSTRAINT, EXTRA_CONSTRAINT_Sr0, EXTRA_CONSTRAINT_Sua, EXTRA_CONSTRAINT_S, EXTRA_CONSTRAINT_STR): Likewise. (GO_IF_LEGITIMATE_INDEX): Fix indentation. From-SVN: r125561
2007-06-08 08:59:55 +02:00
#include "tm-constrs.h"
target.def (handle_option): Take gcc_options and cl_decoded_option pointers and location_t. * target.def (handle_option): Take gcc_options and cl_decoded_option pointers and location_t. * doc/tm.texi.in (TARGET_HANDLE_OPTION): Update documentation. * doc/tm.texi: Regenerate. * hooks.c (hook_bool_size_t_constcharptr_int_true): Remove. * hooks.h (hook_bool_size_t_constcharptr_int_true): Don't declare. * lto-opts.c (lto_reissue_options): Generate option structure for targetm.handle_option call. * opts.c (target_handle_option): Update call to targetm.handle_option. Remove assertions about values now passed down to hook. * targhooks.c (default_target_handle_option): New. * targhooks.h (default_target_handle_option): Declare. * config/alpha/alpha.c: Include opts.h. (alpha_handle_option): Update to new hook interface. * config/arm/arm.c: Include opts.h. (arm_handle_option): Update to new hook interface. * config/arm/t-arm (arm.o): Update dependencies. * config/bfin/bfin.c: Include opts.h. (bfin_handle_option): Update to new hook interface. * config/cris/cris.c: Include opts.h. (cris_handle_option): Update to new hook interface. * config/frv/frv.c: Include opts.h. (frv_handle_option): Update to new hook interface. * config/i386/i386.c: Include opts.h. (ix86_handle_option): Update to new hook interface. (ix86_valid_target_attribute_inner_p): Generate option structure for call to ix86_handle_option. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64.c: Include opts.h. (ia64_handle_option): Update to new hook interface. * config/ia64/t-ia64 (ia64.o): Update dependencies. * config/iq2000/iq2000.c: Include opts.h. (iq2000_handle_option): Update to new hook interface. * config/m32c/m32c.c: Include opts.h. (m32c_handle_option): Update to new hook interface. * config/m32r/m32r.c: Include opts.h. (m32r_handle_option): Update to new hook interface. * config/m68k/m68k.c: Include opts.h. (m68k_handle_option): Update to new hook interface. * config/mep/mep.c: Include opts.h. (mep_handle_option): Update to new hook interface. * config/microblaze/microblaze.c: Include opts.h. (microblaze_handle_option): Update to new hook interface. * config/mips/mips.c: Include opts.h. (mips_handle_option): Update to new hook interface. * config/mn10300/mn10300.c: Include opts.h. (mn10300_handle_option): Update to new hook interface. * config/pa/pa.c: Include opts.h. (pa_handle_option): Update to new hook interface. * config/pdp11/pdp11.c: Include opts.h. (pdp11_handle_option): Update to new hook interface. * config/rs6000/rs6000.c: Include opts.h. (rs6000_handle_option): Update to new hook interface. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c: Include opts.h. (rx_handle_option): Update to new hook interface. * config/s390/s390.c: Include opts.h. (s390_handle_option): Update to new hook interface. * config/score/score.c: Include opts.h. (score_handle_option): Update to new hook interface. * config/sh/sh.c: Include opts.h. (sh_handle_option): Update to new hook interface. * config/sparc/sparc.c: Include opts.h. (sparc_handle_option): Update to new hook interface. * config/v850/v850.c: Include opts.h. (v850_handle_option): Update to new hook interface. From-SVN: r171308
2011-03-22 23:23:02 +01:00
#include "opts.h"
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
#include <sstream>
#include <vector>
#include <algorithm>
1993-04-30 16:29:19 +02:00
int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
#define MSW (TARGET_LITTLE_ENDIAN ? 1 : 0)
#define LSW (TARGET_LITTLE_ENDIAN ? 0 : 1)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* These are some macros to abstract register modes. */
#define CONST_OK_FOR_I10(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -512 \
&& ((HOST_WIDE_INT)(VALUE)) <= 511)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
#define CONST_OK_FOR_ADD(size) \
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
(TARGET_SHMEDIA ? CONST_OK_FOR_I10 (size) : CONST_OK_FOR_I08 (size))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
#define GEN_MOV (*(TARGET_SHMEDIA64 ? gen_movdi : gen_movsi))
#define GEN_ADD3 (*(TARGET_SHMEDIA64 ? gen_adddi3 : gen_addsi3))
#define GEN_SUB3 (*(TARGET_SHMEDIA64 ? gen_subdi3 : gen_subsi3))
/* Used to simplify the logic below. Find the attributes wherever
they may be. */
#define SH_ATTRIBUTES(decl) \
(TYPE_P (decl)) ? TYPE_ATTRIBUTES (decl) \
: DECL_ATTRIBUTES (decl) \
? (DECL_ATTRIBUTES (decl)) \
: TYPE_ATTRIBUTES (TREE_TYPE (decl))
/* Set to 1 by expand_prologue() when the function is an interrupt handler. */
int current_function_interrupt;
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
tree sh_deferred_function_attributes;
tree *sh_deferred_function_attributes_tail = &sh_deferred_function_attributes;
/* Global variables for machine-dependent things. */
1993-04-30 16:29:19 +02:00
/* Which cpu are we scheduling for. */
enum processor_type sh_cpu;
/* Definitions used in ready queue reordering for first scheduling pass. */
/* Reg weights arrays for modes SFmode and SImode, indexed by insn LUID. */
static short *regmode_weight[2];
/* Total SFmode and SImode weights of scheduled insns. */
static int curr_regmode_pressure[2];
/* Number of r0 life regions. */
static int r0_life_regions;
/* If true, skip cycles for Q -> R movement. */
static int skip_cycles = 0;
/* Cached value of can_issue_more. This is cached in sh_variable_issue hook
and returned from sh_reorder2. */
static short cached_can_issue_more;
/* Unique number for UNSPEC_BBR pattern. */
static unsigned int unspec_bbr_uid = 1;
1993-04-30 16:29:19 +02:00
/* Provides the class number of the smallest class containing
reg number. */
1993-04-30 16:29:19 +02:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER] =
1993-04-30 16:29:19 +02:00
{
R0_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
1993-04-30 16:29:19 +02:00
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,
FP0_REGS,FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
FP_REGS, FP_REGS, FP_REGS, FP_REGS,
TARGET_REGS, TARGET_REGS, TARGET_REGS, TARGET_REGS,
TARGET_REGS, TARGET_REGS, TARGET_REGS, TARGET_REGS,
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
DF_REGS, DF_REGS, DF_REGS, DF_REGS,
DF_REGS, DF_REGS, DF_REGS, DF_REGS,
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
NO_REGS, GENERAL_REGS, PR_REGS, T_REGS,
MAC_REGS, MAC_REGS, FPUL_REGS, FPSCR_REGS,
GENERAL_REGS, GENERAL_REGS,
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
};
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
char sh_register_names[FIRST_PSEUDO_REGISTER] \
[MAX_REGISTER_NAME_LENGTH + 1] = SH_REGISTER_NAMES_INITIALIZER;
char sh_additional_register_names[ADDREGNAMES_SIZE] \
[MAX_ADDITIONAL_REGISTER_NAME_LENGTH + 1]
= SH_ADDITIONAL_REGISTER_NAMES_INITIALIZER;
1993-04-30 16:29:19 +02:00
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
int assembler_dialect;
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
static bool shmedia_space_reserved_for_target_registers;
static void split_branches (rtx);
static int branch_dest (rtx);
static void force_into (rtx, rtx);
static void print_slot (rtx);
static rtx add_constant (rtx, enum machine_mode, rtx);
static void dump_table (rtx, rtx);
static bool broken_move (rtx);
static bool mova_p (rtx);
static rtx find_barrier (int, rtx, rtx);
static bool noncall_uses_reg (rtx, rtx, rtx *);
static rtx gen_block_redirect (rtx, int, int);
static void sh_reorg (void);
static void sh_option_override (void);
static void output_stack_adjust (int, rtx, int, HARD_REG_SET *, bool);
static rtx frame_insn (rtx);
static rtx push (int);
static void pop (int);
static void push_regs (HARD_REG_SET *, int);
static int calc_live_regs (HARD_REG_SET *);
static HOST_WIDE_INT rounded_frame_size (int);
static bool sh_frame_pointer_required (void);
static rtx mark_constant_pool_use (rtx);
static tree sh_handle_interrupt_handler_attribute (tree *, tree, tree, int, bool *);
static tree sh_handle_resbank_handler_attribute (tree *, tree,
tree, int, bool *);
static tree sh2a_handle_function_vector_handler_attribute (tree *, tree,
tree, int, bool *);
static tree sh_handle_sp_switch_attribute (tree *, tree, tree, int, bool *);
static tree sh_handle_trap_exit_attribute (tree *, tree, tree, int, bool *);
static tree sh_handle_renesas_attribute (tree *, tree, tree, int, bool *);
static void sh_print_operand (FILE *, rtx, int);
static void sh_print_operand_address (FILE *, rtx);
static bool sh_print_operand_punct_valid_p (unsigned char code);
static bool sh_asm_output_addr_const_extra (FILE *file, rtx x);
static void sh_output_function_epilogue (FILE *, HOST_WIDE_INT);
static void sh_insert_attributes (tree, tree *);
static const char *sh_check_pch_target_flags (int);
static int sh_register_move_cost (enum machine_mode, reg_class_t, reg_class_t);
static int sh_adjust_cost (rtx, rtx, rtx, int);
static int sh_issue_rate (void);
static int sh_dfa_new_cycle (FILE *, int, rtx, int, int, int *sort_p);
static short find_set_regmode_weight (rtx, enum machine_mode);
static short find_insn_regmode_weight (rtx, enum machine_mode);
static void find_regmode_weight (basic_block, enum machine_mode);
static int find_r0_life_regions (basic_block);
static void sh_md_init_global (FILE *, int, int);
static void sh_md_finish_global (FILE *, int);
static int rank_for_reorder (const void *, const void *);
static void swap_reorder (rtx *, int);
static void ready_reorder (rtx *, int);
static bool high_pressure (enum machine_mode);
static int sh_reorder (FILE *, int, rtx *, int *, int);
static int sh_reorder2 (FILE *, int, rtx *, int *, int);
static void sh_md_init (FILE *, int, int);
static int sh_variable_issue (FILE *, int, rtx, int);
static bool sh_function_ok_for_sibcall (tree, tree);
static bool sh_cannot_modify_jumps_p (void);
re PR middle-end/44566 (configuration with multiple targets / backends is not supported.) PR other/44566 * coretypes.h [!USED_FOR_TARGET] (reg_class_t): Define. * target.def (struct gcc_target): Replace enum reg_class with reg_class_t in hook argument / return types. * doc/tm.texi.in (TARGET_SECONDARY_RELOAD): Likewise. (TARGET_IRA_COVER_CLASSES, TARGET_MEMORY_MOVE_COST): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise. * targhooks.h (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * targhooks.c (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * reload.c (push_secondary_reload, secondary_reload_class): Likewise. * bt-load.c (branch_target_load_optimize): Likewise. * ira.c (setup_cover_and_important_classes): Likewise. * ira-costs.c (copy_cost): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_secondary_reload): Likewise. * config/s390/s390.c (s390_secondary_reload): Likewise. * config/i386/i386.c (i386_ira_cover_classes): Likewise. (ix86_secondary_reload, ix86_memory_move_cost): Likewise. (ix86_register_move_cost): Likewise. * config/sh/sh-protos.h (sh_secondary_reload): Likewise. * config/sh/sh.c (sh_target_reg_class, sh_secondary_reload): Likewise. * config/xtensa/xtensa.c (xtensa_secondary_reload): Likewise. * config/xtensa/xtensa-protos.h (xtensa_secondary_reload): Likewise. * config/rs6000/rs6000.c (rs6000_secondary_reload): Likewise. (rs6000_ira_cover_classes): Likewise. * config/picochip/picochip.c (picochip_secondary_reload): Likewise. * config/picochip/picochip-protos.h (picochip_secondary_reload): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * config/mips/mips.c (mips_ira_cover_classes): Likewise. * config/bfin/bfin.c (bfin_secondary_reload): Likewise. * config/ia64/ia64.c (ia64_register_move_cost): Likewise. * doc/tm.texi: Regenerate. From-SVN: r161633
2010-06-30 20:47:43 +02:00
static reg_class_t sh_target_reg_class (void);
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
static bool sh_optimize_target_register_callee_saved (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
static bool sh_ms_bitfield_layout_p (const_tree);
static void sh_init_builtins (void);
static tree sh_builtin_decl (unsigned, bool);
static rtx sh_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void sh_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
static void sh_file_start (void);
static bool flow_dependent_p (rtx, rtx);
alias.c (record_set, [...]): Constify. * alias.c (record_set, memory_modified_1): Constify. * bt-load.c (note_btr_set): Likewise. * caller-save.c (mark_set_regs, add_stored_regs): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, expand_field_assignment, record_dead_and_set_regs_1, use_crosses_set_p, reg_dead_at_p_1, can_combine_p, likely_spilled_retval_1): Likewise. * config/frv/frv.c (frv_registers_update_1, frv_io_check_address, frv_io_handle_set): Likewise. * config/mips/mips.c (mips_sim_record_set, vr4130_true_reg_dependence_p_1): Likewise. * config/mt/mt.c (insn_dependent_p_1): Likewise. * config/s390/s390.c (s390_reg_clobbered_rtx): Likewise. * config/sh/sh.c (flow_dependent_p_1): Likewise. * cselib.c (cselib_invalidate_rtx_note_stores): Likewise. * dce.c (mark_nonreg_stores_1, mark_nonreg_stores_2): Likewise. * ddg.c (mark_mem_store): Likewise. * df-problems.c (df_urec_mark_reg_change): Likewise. * function.c (update_epilogue_consts): Likewise. * gcse.c (record_set_info, record_last_set_info, mems_conflict_for_gcse_p, canon_list_insert, reg_set_info, reg_clear_last_set): Likewise. * global.c (mark_reg_store, mark_reg_clobber, reg_becomes_live): Likewise. * jump.c (reversed_comparison_code_parts): Likewise. * local-alloc.c (validate_equiv_mem_from_store, no_equiv, reg_is_set): Likewise. * loop-iv.c (mark_altered): Likewise. * mode-switching.c (reg_becomes_live): Likewise. * optabs.c (no_conflict_move_test): Likewise. * postreload-gcse.c (record_last_set_info, find_mem_conflicts): Likewise. * postreload.c (reload_combine_note_store, move2add_note_store): Likewise. * regmove.c (flags_set_1): Likewise. * regrename.c (note_sets, kill_clobbered_value, kill_set_value): Likewise. * reload1.c (mark_not_eliminable, forget_old_reloads_1): Likewise. * resource.c (update_live_status): Likewise. * rtl.h (set_of, note_stores): Likewise. * rtlanal.c (set_of_1, parms_set, struct set_of_data, set_of, note_stores, parms_set): Likewise. * sched-rgn.c (sets_likely_spilled_1): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. * var-tracking.c (count_stores, add_stores): Likewise. From-SVN: r127065
2007-07-30 18:30:18 +02:00
static void flow_dependent_p_1 (rtx, const_rtx, void *);
static int shiftcosts (rtx);
static int and_xor_ior_costs (rtx, int);
static int addsubcosts (rtx);
static int multcosts (rtx);
static bool unspec_caller_rtx_p (rtx);
static bool sh_cannot_copy_insn_p (rtx);
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
static bool sh_rtx_costs (rtx, int, int, int, int *, bool);
hooks.c (hook_int_rtx_mode_as_bool_0): New function. * hooks.c (hook_int_rtx_mode_as_bool_0): New function. * hooks.h (hook_int_rtx_mode_as_bool_0): Declare it. * output.h (default_address_cost): Add machine_mode and address space arguments. * target.def (address_cost): Likewise. * rtlanal.c (address_cost): Pass mode and address space to target hook. (default_address_cost): Add unnamed machine_mode and address space arguments. * doc/tm.texi: Regenerate. * config/alpha/alpha.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/arm/arm.c (arm_address_cost): Add machine_mode and address space arguments. * config/avr/avr.c (avr_address_cost): Likewise. * config/bfin/bfin.c (bfin_address_cost): Likewise. * config/cr16/cr16.c (cr16_address_cost): Likewise. * config/cris/cris.c (cris_address_cost): Likewise. * config/epiphany/epiphany.c (epiphany_address_cost): Likewise. * config/i386/i386.c (ix86_address_cost): Likewise. * config/ia64/ia64.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/iq2000/iq2000.c (iq2000_address_cost): Add machine_mode and address space arguments. Pass them on in recursive invocation. * config/lm32/lm32.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/m32c/m32c.c (m32c_address_cost): Add machine_mode and address space arguments. * config/m32r/m32r.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/mcore/mcore.c (TARGET_ADDRESS_COST): Likewise. * config/mep/mep.c (mep_address_cost): Add machine_mode and address space arguments. * config/microblaze/microblaze.c (microblaze_address_cost): Likewise. * config/mips/mips.c (mips_address_cost): Likewise. * config/mmix/mmix.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/mn10300/mn10300.c (mn10300_address_cost): Add machine_mode and address space arguments. (mn10300_rtx_costs): Pass GET_MODE (x) and MEM_ADDR_SPACE (x) to mn10300_address_cost. * config/pa/pa.c (hppa_address_cost): Add machine_mode and address space arguments. * config/rs6000/rs6000.c (rs6000_debug_address_cost): Likewise. (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/rx/rx.c (rx_address_cost): Add machine_mode and address space arguments. * config/s390/s390.c (s390_address_cost): Likewise. * config/score/score-protos.h (score_address_cost): Likewise. * config/score/score.c (score_address_cost): Likewise. * config/sh/sh.c (sh_address_cost): Likewise. * config/sparc/sparc.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/spu/spu.c (TARGET_ADDRESS_COST): Likewise. * config/stormy16/stormy16.c (xstormy16_address_cost): Add machine_mode and address space arguments. * config/v850/v850.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/vax/vax.c (vax_address_cost): Add machine_mode and address space arguments. * config/xtensa/xtensa (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. From-SVN: r190990
2012-09-05 19:31:17 +02:00
static int sh_address_cost (rtx, enum machine_mode, addr_space_t, bool);
static int sh_pr_n_sets (void);
static rtx sh_allocate_initial_value (rtx);
static reg_class_t sh_preferred_reload_class (rtx, reg_class_t);
static reg_class_t sh_secondary_reload (bool, rtx, reg_class_t,
enum machine_mode,
struct secondary_reload_info *);
static bool sh_legitimate_address_p (enum machine_mode, rtx, bool);
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
static rtx sh_legitimize_address (rtx, rtx, enum machine_mode);
static rtx sh_delegitimize_address (rtx);
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
static int shmedia_target_regs_stack_space (HARD_REG_SET *);
static int shmedia_reserve_space_for_target_registers_p (int, HARD_REG_SET *);
static int shmedia_target_regs_stack_adjust (HARD_REG_SET *);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
static int scavenge_reg (HARD_REG_SET *s);
struct save_schedule_s;
static struct save_entry_s *sh5_schedule_saves (HARD_REG_SET *,
struct save_schedule_s *, int);
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
static rtx sh_struct_value_rtx (tree, int);
static rtx sh_function_value (const_tree, const_tree, bool);
static bool sh_function_value_regno_p (const unsigned int);
static rtx sh_libcall_value (enum machine_mode, const_rtx);
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 sh_return_in_memory (const_tree, const_tree);
static rtx sh_builtin_saveregs (void);
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
static void sh_setup_incoming_varargs (cumulative_args_t, enum machine_mode, tree, int *, int);
static bool sh_strict_argument_naming (cumulative_args_t);
static bool sh_pretend_outgoing_varargs_named (cumulative_args_t);
static tree sh_build_builtin_va_list (void);
re PR middle-end/20983 (varargs functions force va_list variable to stack unnecessarily) PR middle-end/20983 * tree-ssa-ccp.c (optimize_stdarg_builtin): New function. (execute_fold_all_builtins): Call it for BUILT_IN_VA_START, BUILT_IN_VA_COPY and BUILT_IN_VA_END. * target.h (struct ggc_target): Add expand_builtin_va_start hook. * target-def.h (TARGET_EXPAND_BUILTIN_VA_START): Define. (TARGET_INITIALIZER): Add it. * builtins.c (expand_builtin_va_start): Use targetm.expand_builtin_va_start hook instead of EXPAND_BUILTIN_VA_START macro. * alpha/alpha.c (alpha_va_start): Made static. (override_options): Clear targetm.expand_builtin_va_start if TARGET_UNICOSMK. (TARGET_EXPAND_BUILTIN_VA_START): Define. * alpha/unicosmk.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha-protos.h (alpha_va_start): Remove prototype. * xtensa/xtensa.h (EXPAND_BUILTIN_VA_START): Remove. * xtensa/xtensa.c (TARGET_EXPAND_BUILTIN_VA_START): Define. (xtensa_va_start): Made static. * xtensa/xtensa-protos.h (xtensa_va_start): Remove prototype. * pa/pa-protos.h (hppa_va_start): Remove prototype. * pa/pa.h (EXPAND_BUILTIN_VA_START): Remove. * pa/pa.c (hppa_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv.c (frv_expand_builtin_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv-protos.h (frv_expand_builtin_va_start): Remove prototype. * frv/frv.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386.c (override_options): Clear targetm.expand_builtin_va_start if -m32 or 64-bit MS ABI. (ix86_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * i386/i386.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386-protos.h (ix86_va_start, ix86_va_arg): Remove prototypes. * iq2000/iq2000-protos.h (iq2000_va_start): Remove prototype. * iq2000/iq2000.h (EXPAND_BUILTIN_VA_START): Remove. * iq2000/iq2000.c (iq2000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * rs6000/rs6000-protos.h (rs6000_va_start): Remove prototype. * rs6000/rs6000.c (rs6000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. (rs6000_override_options): Clear targetm.expand_builtin_va_start if DEFAULT_ABI != ABI_V4. * rs6000/rs6000.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu.c (spu_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * spu/spu.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu-protos.h spu_va_start): Remove prototype. * stormy16/stormy16.h (EXPAND_BUILTIN_VA_START): Remove. * stormy16/stormy16-protos.h (xstormy16_expand_builtin_va_start): Remove prototype. * stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390-protos.h (s390_va_start): Remove prototype. * s390/s390.c (s390_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300-protos.h (mn10300_va_start): Remove prototype. * mn10300/mn10300.c (mn10300_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.c (arc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.h (EXPAND_BUILTIN_VA_START): Remove. * arc/arc-protos.h (arc_va_start): Remove prototype. * mt/mt-protos.h (mt_va_start): Remove prototype. * sparc/sparc.c (sparc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sparc/sparc-protos.h (sparc_va_start): Remove prototype. * sparc/sparc.h (EXPAND_BUILTIN_VA_START): Remove. * sh/sh.c (sh_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sh/sh-protos.h (sh_va_start): Remove prototype. * sh/sh.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips-protos.h (mips_va_start): Remove prototype. * mips/mips.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips.c (mips_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. From-SVN: r130650
2007-12-06 14:25:37 +01:00
static void sh_va_start (tree, rtx);
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 sh_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
static bool sh_promote_prototypes (const_tree);
static enum machine_mode sh_promote_function_mode (const_tree type,
enum machine_mode,
int *punsignedp,
const_tree funtype,
int for_return);
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
static bool sh_pass_by_reference (cumulative_args_t, 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
const_tree, bool);
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
static bool sh_callee_copies (cumulative_args_t, 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
const_tree, bool);
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
static int sh_arg_partial_bytes (cumulative_args_t, enum machine_mode,
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
tree, bool);
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
static void sh_function_arg_advance (cumulative_args_t, enum machine_mode,
const_tree, bool);
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
static rtx sh_function_arg (cumulative_args_t, enum machine_mode,
const_tree, bool);
static bool sh_scalar_mode_supported_p (enum machine_mode);
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 int sh_dwarf_calling_convention (const_tree);
static void sh_encode_section_info (tree, rtx, int);
static bool sh2a_function_vector_p (tree);
static void sh_trampoline_init (rtx, tree, rtx);
static rtx sh_trampoline_adjust_address (rtx);
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
static void sh_conditional_register_usage (void);
target.def (legitimate_constant_p): New hook. gcc/ * target.def (legitimate_constant_p): New hook. * doc/tm.texi.in (LEGITIMATE_CONSTANT_P): Replace with... (TARGET_LEGITIMATE_CONSTANT_P): ...this. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_true): Declare. * hooks.c (hook_bool_mode_rtx_true): Define. * system.h (LEGITIMATE_CONSTANT_P): Poison. * calls.c (precompute_register_parameters): Replace uses of LEGITIMATE_CONSTANT_P with targetm.legitimate_constant_p. (emit_library_call_value_1): Likewise. * expr.c (move_block_to_reg, can_store_by_pieces, emit_move_insn) (compress_float_constant, emit_push_insn, expand_expr_real_1): Likewise. * ira-costs.c (scan_one_insn): Likewise. * recog.c (general_operand, immediate_operand): Likewise. * reload.c (find_reloads_toplev, find_reloads_address_part): Likewise. * reload1.c (init_eliminable_invariants): Likewise. * config/alpha/alpha-protos.h (alpha_legitimate_constant_p): Add a mode argument. * config/alpha/alpha.h (LEGITIMATE_CONSTANT_P): Delete. * config/alpha/alpha.c (alpha_legitimate_constant_p): Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/alpha/predicates.md (input_operand): Update call to alpha_legitimate_constant_p. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Delete. * config/arm/arm.h (ARM_LEGITIMATE_CONSTANT_P): Likewise. (THUMB_LEGITIMATE_CONSTANT_P, LEGITIMATE_CONSTANT_P): Likewise. * config/arm/arm.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (arm_legitimate_constant_p_1, thumb_legitimate_constant_p) (arm_legitimate_constant_p): New functions. (arm_cannot_force_const_mem): Make static. * config/avr/avr.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Delete. * config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin.c (expand_move): Use targetm.legitimate_constant_p instead of bfin_legitimate_constant_p. (bfin_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/cris/cris.h (LEGITIMATE_CONSTANT_P): Delete. * config/fr30/fr30.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_constant_p): Delete. * config/frv/frv.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (frv_legitimate_constant_p): Make static. Add a mode argument. * config/h8300/h8300-protos.h (h8300_legitimate_constant_p): Delete. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/h8300/h8300.c (h8300_legitimate_constant_p): Likewise. * config/i386/i386-protos.h (legitimate_constant_p): Delete. * config/i386/i386.h (LEGITIMATE_CONSTANT_P): Likewise. * config/i386/i386.c (legitimate_constant_p): Rename to... (ix86_legitimate_constant_p): ...this. Make static. Add a mode argument. (ix86_cannot_force_const_mem): Update accordingly. (ix86_legitimate_address_p): Likewise. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/i386/i386.md: Update commentary. * config/ia64/ia64-protos.h (ia64_legitimate_constant_p): Delete. * config/ia64/ia64.h (LEGITIMATE_CONSTANT_P): Likewise. * config/ia64/ia64.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (ia64_legitimate_constant_p): Make static. Add a mode argument. * config/iq2000/iq2000.h (LEGITIMATE_CONSTANT_P): Delete. * config/lm32/lm32-protos.h (lm32_legitimate_constant_p): Delete. * config/lm32/lm32.h (LEGITIMATE_CONSTANT_P): Likewise. * config/lm32/lm32.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (lm32_legitimate_constant_p): Make static. Add a mode argument. * config/m32c/m32c-protos.h (m32c_legitimate_constant_p): Delete. * config/m32c/m32c.h (LEGITIMATE_CONSTANT_P): Likewise. * config/m32c/m32c.c (m32c_legitimate_constant_p): Likewise. * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Delete. * config/m32r/m32r.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (m32r_legitimate_constant_p): New function. * config/m68k/m68k-protos.h (m68k_legitimate_constant_p): Declare. * config/m68k/m68k.h (CONSTANT_ADDRESS_P): Call it instead of LEGITIMATE_CONSTANT_P. (LEGITIMATE_CONSTANT_P): Delete. * config/m68k/m68k.c (m68k_expand_prologue): Call m68k_legitimate_constant_p instead of LEGITIMATE_CONSTANT_P. (m68k_legitimate_constant_p): New function. * config/m68k/m68k.md: Update comments. * config/mcore/mcore.h (LEGITIMATE_CONSTANT_P): Delete. * config/mcore/mcore.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mcore_legitimate_constant_p): New function. * config/mep/mep-protos.h (mep_legitimate_constant_p): Delete. * config/mep/mep.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mep/mep.c (mep_legitimate_constant_p): Make static. Add a mode argument. (mep_legitimate_address): Update accordingly. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/microblaze/microblaze-protos.h (microblaze_const_double_ok): Delete. * config/microblaze/microblaze.h (LEGITIMATE_CONSTANT_P): Likewise. * config/microblaze/microblaze.c (microblaze_const_double_ok): Make static. Check OP's mode for VOIDmode. (microblaze_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Delete. * config/mips/mips.c (mips_legitimate_constant_p): New function. (mips_cannot_force_const_mem): Use it instead of LEGITIMATE_CONSTANT_P. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/predicates.md: Update comments. * config/mmix/mmix-protos.h (mmix_legitimate_constant_p): Delete. * config/mmix/mmix.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mmix/mmix.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mmix_legitimate_constant_p): Make static, return a bool, and take a mode argument. (mmix_print_operand_address): Update accordingly. * config/mn10300/mn10300-protos.h (mn10300_legitimate_constant_p): Delete. * config/mn10300/mn10300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mn10300/mn10300.c (mn10300_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/moxie/moxie.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pa_legitimate_constant_p): New function. * config/picochip/picochip.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pdp11_legitimate_constant_p): New function. * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Delete. * config/rs6000/rs6000.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (rs6000_legitimate_constant_p): New function. * config/rx/rx-protos.h (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. * config/rx/rx.h (LEGITIMATE_CONSTANT_P): Delete. * config/rx/rx.c (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/rx/rx.md (mov<register_modes:mode>): Update accordingly. * config/s390/s390-protos.h (legitimate_constant_p): Delete. * config/s390/s390.h (LEGITIMATE_CONSTANT_P): Likewise. * config/s390/s390.c (legitimate_constant_p): Rename to... (s390_legitimate_constant_p): ...this. Make static, return a bool, and add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/score/score.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (sh_legitimate_constant_p): New function. * config/sparc/sparc-protos.h (legitimate_constant_p): Delete. * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Delete. * config/sparc/sparc.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (legitimate_constant_p): Rename to... (sparc_legitimate_constant_p): ...this. Make static. Add a mode argument. (constant_address_p): Update accordingly. * config/spu/spu-protos.h (spu_legitimate_constant_p): Add a mode argument and return a bool. * config/spu/spu.h (LEGITIMATE_CONSTANT_P): Delete. * config/spu/spu.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (spu_legitimate_constant_p): Add a mode argument and return a bool. (spu_rtx_costs): Update accordingly. * config/spu/predicates.md (vec_imm_operand): Likewise. * config/stormy16/stormy16.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.c (v850_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/vax/vax-protos.h (legitimate_constant_p): Delete. * config/vax/vax.h (LEGITIMATE_CONSTANT_P): Likewise. * config/vax/vax.c (legitimate_constant_p): Likewise. * config/xtensa/xtensa.h (LEGITIMATE_CONSTANT_P): Delete. * config/xtensa/xtensa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (xtensa_legitimate_constant_p): New function. From-SVN: r172814
2011-04-21 11:38:43 +02:00
static bool sh_legitimate_constant_p (enum machine_mode, rtx);
static int mov_insn_size (enum machine_mode, bool);
static int max_mov_insn_displacement (enum machine_mode, bool);
static int mov_insn_alignment_mask (enum machine_mode, bool);
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
static HOST_WIDE_INT disp_addr_displacement (rtx);
static bool sequence_insn_p (rtx);
static void sh_init_sync_libfuncs (void) ATTRIBUTE_UNUSED;
arc.c: Include "df.h". * config/arc/arc.c: Include "df.h". (arc_attribute_table): Make static. Move higher in file. (arc_address_cost): Call SMALL_INT on INTVAL, not rtx. (output_shift): Initialize n later to avoid warning. * config/arm/arm.c (arm_attribute_table): Make static. Move higher in file. * config/avr/avr.c (avr_attribute_table): Make static. Move higher in file. (reg_class_tab): Change array type from int to enum reg_class. (avr_jump_mode): Change GET_MODE to GET_CODE when checking for LABEL_REF. (out_tsthi, ashlhi3_out): Don't use AS2 with "or" or "and". (lshrhi3_out): Likewise. (class_likely_spilled_p): Change return type to bool. (avr_rtx_costs): Use local code variable with enum type. * config/avr/avr.md (movmemhi): Use add_reg_note. (andhi3, andsi3): Don't use AS2 with "and". (iorhi3, iorsi3): Don't use AS2 with "or". * config/avr/avr-protos.h (class_likely_spilled_p): Update declaration. * config/crx/crx.c: Include "df.h". (crx_attribute_table): Make static. * config/m32r/m32r.c: Include "df.h". (m32r_attribute_table): Make static. Move higher in file. (pop): Use add_reg_note. (block_move_call): Change 0 to LCT_NORMAL in function call. * config/m32r/m32r.md (movsi_insn): Remove unused local value. * config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Likewise. * config/m32r/m32r-protos.h (m32r_compute_function_type): Always declare, not just when TREE_CODE is defined. * config/m68hc11/m68hc11.c: Include "expr.h". (m68hc11_attribute_table): Make static. Move higher in file. (m68hc11_small_indexed_indirect_p): Change 0 to VOIDmode in function call. (m68hc11_register_indirect_p): Likewise. (m68hc11_function_arg_padding): Change return type to enum direction. (emit_move_after_reload): Use add_reg_note. (m68hc11_emit_logical): Change code parameter to enum rtx_code. (m68hc11_split_logical): Likewise. (m68hc11_rtx_costs): Add local code_and outer_code variables with enum type. * config/m68hc11/predicates.md (reg_or_some_mem_operand): Change 0 to VOIDmode in function call. * config/m68hc11/m68hc11-protos.h: Don't check TREE_CODE to see if tree is defined. (m68hc11_split_logical): Update declaration. (m68hc11_function_arg_padding): Update declaration. * config/mcore/mcore.c (regno_reg_class): Change form array of int to array of enum reg_class. (mcore_attribute_table): Make static. Move higher in file. (mcore_rtx_costs): Add cast to enum type. * config/mcore/mcore.h (regno_reg_class): Update declaration. (GO_IF_LEGITIMATE_INDEX): Add cast to avoid warning. * config/sh/sh.c (sh_attribute_table): Make static. Move higher in file. * config/sh/predicates.md (trapping_target_operand): Rename and to and_expr. * config/sparc/sparc.c (sparc_attribute_table): Make static. Move higher in file. * config/spu/spu.c (spu_attribute_table): Make static. Move higher in file. * config/v850/v850.c (v850_attribute_table): Make static. Move higher in file. (v850_rtx_costs): Use local code with enum type. (expand_epilogue): Add cast. * config/v850/v850-c.c (ghs_pragma_section): Initialize repeat. From-SVN: r148927
2009-06-25 08:16:11 +02:00
static const struct attribute_spec sh_attribute_table[] =
{
ChangeLog gcc/ 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * doc/plugins.texi: Adjust documentation for plugin register_callback. * tree.h (attribute_spec): Add new member affects_type_identity. - Zitierten Text anzeigen - * attribs.c (empty_attribute_table): Adjust attribute_spec initializers. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin.h: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/cygming.h: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/sh/sh.c: Likewise. * config/sol2.h: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850.c: Likewise. ChangeLog gcc/cp 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * tree.c (cxx_attribute_table): Adjust table. ChangeLog gcc/testsuite 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * g++.dg/plugin/attribute_plugin.c: Adjust test. ChangeLog gcc/java 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * lang.c (java_attribute_table): Adjust table. ChangeLog gcc/lto 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * lto-lang.c (lto_attribute_table): Adjust table. ChangeLog gcc/ada 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * gcc-interface/utils.c (gnat_internal_attribute_table): Add new element. ChangeLog gcc/c-family 2011-03-17 Kai Tietz PR target/12171 * c-common.c (c_common_attribute_table): Add new element. (c_common_format_attribute_table): Likewise. From-SVN: r171209
2011-03-21 09:29:36 +01:00
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler,
affects_type_identity } */
{ "interrupt_handler", 0, 0, true, false, false,
sh_handle_interrupt_handler_attribute, false },
{ "sp_switch", 1, 1, true, false, false,
sh_handle_sp_switch_attribute, false },
{ "trap_exit", 1, 1, true, false, false,
sh_handle_trap_exit_attribute, false },
{ "renesas", 0, 0, false, true, false,
sh_handle_renesas_attribute, false },
{ "trapa_handler", 0, 0, true, false, false,
sh_handle_interrupt_handler_attribute, false },
{ "nosave_low_regs", 0, 0, true, false, false,
sh_handle_interrupt_handler_attribute, false },
{ "resbank", 0, 0, true, false, false,
sh_handle_resbank_handler_attribute, false },
{ "function_vector", 1, 1, true, false, false,
sh2a_handle_function_vector_handler_attribute, false },
{ NULL, 0, 0, false, false, false, NULL, false }
arc.c: Include "df.h". * config/arc/arc.c: Include "df.h". (arc_attribute_table): Make static. Move higher in file. (arc_address_cost): Call SMALL_INT on INTVAL, not rtx. (output_shift): Initialize n later to avoid warning. * config/arm/arm.c (arm_attribute_table): Make static. Move higher in file. * config/avr/avr.c (avr_attribute_table): Make static. Move higher in file. (reg_class_tab): Change array type from int to enum reg_class. (avr_jump_mode): Change GET_MODE to GET_CODE when checking for LABEL_REF. (out_tsthi, ashlhi3_out): Don't use AS2 with "or" or "and". (lshrhi3_out): Likewise. (class_likely_spilled_p): Change return type to bool. (avr_rtx_costs): Use local code variable with enum type. * config/avr/avr.md (movmemhi): Use add_reg_note. (andhi3, andsi3): Don't use AS2 with "and". (iorhi3, iorsi3): Don't use AS2 with "or". * config/avr/avr-protos.h (class_likely_spilled_p): Update declaration. * config/crx/crx.c: Include "df.h". (crx_attribute_table): Make static. * config/m32r/m32r.c: Include "df.h". (m32r_attribute_table): Make static. Move higher in file. (pop): Use add_reg_note. (block_move_call): Change 0 to LCT_NORMAL in function call. * config/m32r/m32r.md (movsi_insn): Remove unused local value. * config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Likewise. * config/m32r/m32r-protos.h (m32r_compute_function_type): Always declare, not just when TREE_CODE is defined. * config/m68hc11/m68hc11.c: Include "expr.h". (m68hc11_attribute_table): Make static. Move higher in file. (m68hc11_small_indexed_indirect_p): Change 0 to VOIDmode in function call. (m68hc11_register_indirect_p): Likewise. (m68hc11_function_arg_padding): Change return type to enum direction. (emit_move_after_reload): Use add_reg_note. (m68hc11_emit_logical): Change code parameter to enum rtx_code. (m68hc11_split_logical): Likewise. (m68hc11_rtx_costs): Add local code_and outer_code variables with enum type. * config/m68hc11/predicates.md (reg_or_some_mem_operand): Change 0 to VOIDmode in function call. * config/m68hc11/m68hc11-protos.h: Don't check TREE_CODE to see if tree is defined. (m68hc11_split_logical): Update declaration. (m68hc11_function_arg_padding): Update declaration. * config/mcore/mcore.c (regno_reg_class): Change form array of int to array of enum reg_class. (mcore_attribute_table): Make static. Move higher in file. (mcore_rtx_costs): Add cast to enum type. * config/mcore/mcore.h (regno_reg_class): Update declaration. (GO_IF_LEGITIMATE_INDEX): Add cast to avoid warning. * config/sh/sh.c (sh_attribute_table): Make static. Move higher in file. * config/sh/predicates.md (trapping_target_operand): Rename and to and_expr. * config/sparc/sparc.c (sparc_attribute_table): Make static. Move higher in file. * config/spu/spu.c (spu_attribute_table): Make static. Move higher in file. * config/v850/v850.c (v850_attribute_table): Make static. Move higher in file. (v850_rtx_costs): Use local code with enum type. (expand_epilogue): Add cast. * config/v850/v850-c.c (ghs_pragma_section): Initialize repeat. From-SVN: r148927
2009-06-25 08:16:11 +02:00
};
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 sh_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 (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
/* The next two are used for debug info when compiling with -gdwarf. */
#undef TARGET_ASM_UNALIGNED_HI_OP
#define TARGET_ASM_UNALIGNED_HI_OP "\t.uaword\t"
#undef TARGET_ASM_UNALIGNED_SI_OP
#define TARGET_ASM_UNALIGNED_SI_OP "\t.ualong\t"
tm.texi.in (OVERRIDE_OPTIONS): Remove documentation. * doc/tm.texi.in (OVERRIDE_OPTIONS): Remove documentation. (C_COMMON_OVERRIDE_OPTIONS): Don't refer to OVERRIDE_OPTIONS. * doc/tm.texi: Regenerate. * system.h (OVERRIDE_OPTIONS): Poison. * target.def (override): Default to hook_void_void. * targhooks.c (default_target_option_override): Remove. * genmodes.c, machmode.def: Update comments mentioning OVERRIDE_OPTIONS. * config/alpha/alpha-modes.def: Update comment mentioning alpha_override_options. * config/alpha/alpha-protos.h (override_options): Remove. * config/alpha/alpha.c (override_options): Rename to alpha_option_override. Call SUBTARGET_OVERRIDE_OPTIONS. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/alpha/alpha.h (OVERRIDE_OPTIONS): Remove. * config/alpha/vms.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/arc/arc-protos.h (arc_init): Remove. * config/arc/arc.c (TARGET_OPTION_OVERRIDE): Define. (arc_init): Rename to arc_option_override. Make static. * config/arc/arc.h (ARC_EXTENSION_CPU): Correct comment. (OVERRIDE_OPTIONS): Remove. * config/arm/arm-protos.h (arm_override_options): Remove. * config/arm/arm.c (TARGET_OPTION_OVERRIDE): Define. (arm_override_options): Rename to arm_option_override. Make static. Call SUBTARGET_OVERRIDE_OPTIONS. * config/arm/arm.h (OVERRIDE_OPTIONS): Remove. * config/arm/arm.md: Update comment referring to arm_override_options. * config/arm/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/avr/avr-protos.h (avr_override_options): Remove. * config/avr/avr.c (TARGET_OPTION_OVERRIDE): Define. (avr_override_options): Rename to avr_option_override. Make static. * config/avr/avr.h (OVERRIDE_OPTIONS): Remove. * config/bfin/bfin-protos.h (override_options): Remove (twice). * config/bfin/bfin.c (override_options): Rename to bfin_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/bfin/bfin.h (OVERRIDE_OPTIONS): Remove. * config/cris/cris-protos.h (cris_override_options): Remove. * config/cris/cris.c (TARGET_OPTION_OVERRIDE): Define. (cris_override_options): Rename to cris_option_override. Make static. * config/cris/cris.h (OVERRIDE_OPTIONS): Remove. * config/frv/frv-protos.h (frv_override_options): Remove. * config/frv/frv.c (TARGET_OPTION_OVERRIDE): Define. (frv_override_options): Rename to frv_option_override. Make static. * config/frv/frv.h (OVERRIDE_OPTIONS): Remove. * config/h8300/h8300-protos.h (h8300_init_once): Remove. * config/h8300/h8300.c (h8300_init_once): Rename to h8300_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/h8300/h8300.h (OVERRIDE_OPTIONS): Remove. * config/i386/i386-protos.h (override_options): Remove. * config/i386/i386.c (override_options): Rename to ix86_option_override_internal. Make static. Comments referring to this function and callers changed. (ix86_option_override): New. (TARGET_OPTION_OVERRIDE): Define. * config/i386/i386.h (OVERRIDE_OPTION): Remove. * config/i386/linux64.h (DEFAULT_PCC_STRUCT_RETURN): Update comment. * config/ia64/ia64.c (ia64_file_start): Update comment referring to ia64_override_options. * config/iq2000/iq2000-protos.h (override_options): Remove. * config/iq2000/iq2000.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to iq2000_option_override. Make static. * config/iq2000/iq2000.h (OVERRIDE_OPTIONS): Remove. * config/lm32/lm32-protos.h (lm32_override_options): Remove. * config/lm32/lm32.c (TARGET_OPTION_OVERRIDE): Define. (lm32_override_options): Rename to lm32_option_override. Make static. * config/lm32/lm32.h (OVERRIDE_OPTIONS): Remove. * config/m32r/m32r.c (TARGET_OPTION_OVERRIDE): Define. (m32r_option_override): New. (m32r_init): Update comment. * config/m32r/m32r.h (OVERRIDE_OPTIONS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_override_options): Remove. * config/m68hc11/m68hc11.c (TARGET_OPTION_OVERRIDE): Define. (m68hc11_override_options): Rename to m68hc11_option_override. Make static. Return void. * config/m68hc11/m68hc11.h (OVERRIDE_OPTIONS): Remove. * config/m68k/m68k-protos.h (override_options): Remove. * config/m68k/m68k.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to m68k_option_override. Make static. * config/m68k/m68k.h (OVERRIDE_OPTIONS): Remove. * config/mcore/mcore-protos.h (mcore_override_options): Remove. * config/mcore/mcore.c (TARGET_OPTION_OVERRIDE): Define. (mcore_override_options): Rename to mcore_option_override. Make static. * config/mcore/mcore.h (OVERRIDE_OPTIONS): Remove. * config/mep/mep-protos.h (mep_override_options): Remove. * config/mep/mep.c (TARGET_OPTION_OVERRIDE): Define. (mep_override_options): Rename to mep_option_override. Make static. * config/mep/mep.h (OVERRIDE_OPTIONS): Remove. * config/mmix/mmix-protos.h (mmix_override_options): Remove. * config/mmix/mmix.c (TARGET_OPTION_OVERRIDE): Define. (mmix_override_options): Rename to mmix_option_override. Make static. * config/mmix/mmix.h (OVERRIDE_OPTIONS): Remove. * config/mn10300/mn10300-protos.h (mn10300_override_options): Remove. * config/mn10300/mn10300.c (TARGET_OPTION_OVERRIDE): Define. (mn10300_override_options): Rename to mn10300_option_override. Make static. * config/mn10300/mn10300.h (OVERRIDE_OPTIONS): Remove. * config/moxie/moxie-protos.h (moxie_override_options): Remove. * config/moxie/moxie.c (moxie_override_options): Rename to moxie_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/moxie/moxie.h (OVERRIDE_OPTIONS): Remove. * config/picochip/picochip-protos.h (picochip_override_options): Remove. Update comment referring to picochip_override_options. * config/picochip/picochip.c (TARGET_OPTION_OVERRIDE): Define. (picochip_override_options): Rename to picochip_option_override. Make static. Update comment and definition of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE. * config/picochip/picochip.h (OVERRIDE_OPTIONS): Remove. * config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix51.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/linux64.h (OPTION_TARGET_CPU_DEFAULT): Define instead of OVERRIDE_OPTIONS. * config/rs6000/rs6000-modes.def: Update comment referring to rs6000_override_options. * config/rs6000/rs6000-protos.h (rs6000_override_options): Remove. * config/rs6000/rs6000.c (TARGET_OPTION_OVERRIDE): Define. (rs6000_override_options): Rename to rs6000_option_override_internal. Make static. Commented referring to rs6000_override_options and OVERRIDE_OPTIONS updated. (rs6000_option_override): New. * config/rs6000/rs6000.h (OPTION_TARGET_CPU_DEFAULT): Define instead of OVERRIDE_OPTIONS. * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/s390/s390-protos.h (override_options): Remove. * config/s390/s390.c (override_options): Rename to s390_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/s390/s390.h (OVERRIDE_OPTIONS): Remove. * config/score/score-protos.h (score_override_options): Remove. * config/score/score.c (TARGET_OPTION_OVERRIDE): Define. (score_override_options): Rename to score_option_override. Make static. * config/score/score.h (OVERRIDE_OPTIONS): Remove. Update comment referring to override_options. * config/score/score3.c (score3_override_options): Rename to score3_option_override. * config/score/score3.h (score3_override_options): Rename to score3_option_override. * config/score/score7.c (score7_override_options): Rename to score7_option_override. * config/score/score7.h (score7_override_options): Rename to score7_option_override. * config/sh/sh.c: Update comments referring to OVERRIDE_OPTIONS. * config/sparc/sparc.c (TARGET_OPTION_OVERRIDE): Define. (sparc_override_options): Rename to sparc_option_override. Make static. Call SUBTARGET_OVERRIDE_OPTIONS. * config/sparc/sparc.h (OVERRIDE_OPTIONS): Remove. * config/sparc/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/spu/spu-protos.h (spu_override_options): Remove. * config/spu/spu.c (TARGET_OPTION_OVERRIDE): Define. (spu_override_options): Rename to spu_option_override. Make static. * config/spu/spu.h (OVERRIDE_OPTIONS): Remove. * config/vax/elf.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/vax/vax-protos.h (override_options): Remove. * config/vax/vax.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to vax_option_override. Make static. Call SUBTARGET_OVERRIDE_OPTIONS. * config/vax/vax.h (OVERRIDE_OPTIONS): Remove. * config/vxworks.c: Update comment referring to OVERRIDE_OPTIONS. * config/vxworks.h: Update comment referring to OVERRIDE_OPTIONS. * config/xtensa/xtensa-protos.h (override_options): Remove. * config/xtensa/xtensa.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to xtensa_option_override. Make static. * config/xtensa/xtensa.h (OVERRIDE_OPTIONS): Remove. From-SVN: r164334
2010-09-16 13:59:39 +02:00
/* These are NULLed out on non-SH5 in TARGET_OPTION_OVERRIDE. */
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
#undef TARGET_ASM_UNALIGNED_DI_OP
#define TARGET_ASM_UNALIGNED_DI_OP "\t.uaquad\t"
#undef TARGET_ASM_ALIGNED_DI_OP
#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t"
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE sh_option_override
#undef TARGET_PRINT_OPERAND
#define TARGET_PRINT_OPERAND sh_print_operand
#undef TARGET_PRINT_OPERAND_ADDRESS
#define TARGET_PRINT_OPERAND_ADDRESS sh_print_operand_address
#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P
#define TARGET_PRINT_OPERAND_PUNCT_VALID_P sh_print_operand_punct_valid_p
#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA sh_asm_output_addr_const_extra
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 sh_output_function_epilogue
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK sh_output_mi_thunk
#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 sh_file_start
#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST sh_register_move_cost
target.h (struct gcc_target): Add insert_attributes. * target.h (struct gcc_target): Add insert_attributes. * target-def.h (TARGET_INSERT_ATTRIBUTES): Define. (TARGET_INITIALIZER): Update. * tree.c, tree.h (default_insert_attributes): New function. Update comments on other default functions to refer to targetm, not target. * doc/tm.texi (INSERT_ATTRIBUTES): Update to document TARGET_INSERT_ATTRIBUTES. (SET_DEFAULT_DECL_ATTRIBUTES): Remove. * c-common.c (decl_attributes): Use targetm.insert_attributes. Don't use PRAGMA_INSERT_ATTRIBUTES. * Makefile.in (c-common.o): Depend on $(TARGET_H). * c-decl.c (start_decl, start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. * config/c4x/c4x.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. * config/c4x/c4x-protos.h (c4x_set_default_attributes): Don't declare. * config/c4x/c4x.c (TARGET_INSERT_ATTRIBUTES): Define. (c4x_check_attribute): Avoid modifying attribute list itself. (c4x_set_default_attributes): Rename to c4x_insert_attributes. Make static. * config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Don't define. * config/sh/sh-protos.h (sh_pragma_insert_attributes): Don't declare. * config/sh/sh.c (TARGET_INSERT_ATTRIBUTES): Define. (sh_pragma_insert_attributes): Rename to sh_insert_attributes. Make static. * config/v850/v850.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. * config/v850/v850-protos.h (v850_set_default_decl_attr): Don't declare. * config/v850/v850.c (TARGET_INSERT_ATTRIBUTES): Define. (v850_set_default_decl_attr): Rename to v850_insert_attributes. Adjust parameters. Make static. cp: * decl.c (start_decl): Don't call SET_DEFAULT_DECL_ATTRIBUTES. (start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. Call cplus_decl_attributes even if attrs is NULL. * friend.c (do_friend): Don't call SET_DEFAULT_DECL_ATTRIBUTES. From-SVN: r43851
2001-07-08 22:05:17 +02:00
#undef TARGET_INSERT_ATTRIBUTES
#define TARGET_INSERT_ATTRIBUTES sh_insert_attributes
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_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST sh_adjust_cost
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE sh_issue_rate
/* The next 5 hooks have been implemented for reenabling sched1. With the
help of these macros we are limiting the movement of insns in sched1 to
reduce the register pressure. The overall idea is to keep count of SImode
and SFmode regs required by already scheduled insns. When these counts
cross some threshold values; give priority to insns that free registers.
The insn that frees registers is most likely to be the insn with lowest
LUID (original insn order); but such an insn might be there in the stalled
queue (Q) instead of the ready queue (R). To solve this, we skip cycles
LANGUAGES: Fix typos. * LANGUAGES: Fix typos. * Makefile.in: Fix typos. * alias.c: Fix typos. * auto-inc-dec.c: Fix typos. * bb-reorder.c: Fix typos. * cfgcleanup.c: Fix typos. * cgraph.c: Fix typos. * cgraph.h: Fix typos. * cgraphunit.c: Fix typos. * collect2-aix.h: Fix typos. * collect2.c: Fix typos. * compare-elim.c: Fix typos. * config/alpha/vms.h: Fix typos. * config/arm/README-interworking: Fix typos. * config/arm/arm.c: Fix typos. * config/arm/iterators.md: Fix typos. * config/arm/vxworks.h: Fix typos. * config/avr/avr.c: Fix typos. * config/avr/avr.h: Fix typos. * config/avr/avr.md: Fix typos. * config/avr/builtins.def: Fix typos. * config/c6x/c6x.c: Fix typos. * config/cr16/cr16.c: Fix typos. * config/cr16/cr16.md: Fix typos. * config/cris/cris.md: Fix typos. * config/darwin.c: Fix typos. * config/darwin.opt: Fix typos. * config/i386/i386-c.c: Fix typos. * config/i386/i386.c: Fix typos. * config/ia64/ia64.c: Fix typos. * config/m68k/cf.md: Fix typos. * config/mep/mep.c: Fix typos. * config/microblaze/microblaze.c: Fix typos. * config/microblaze/microblaze.h: Fix typos. * config/mn10300/mn10300.c: Fix typos. * config/mn10300/mn10300.md: Fix typos. * config/pa/pa.c: Fix typos. * config/picochip/picochip.h: Fix typos. * config/rs6000/a2.md: Fix typos. * config/rs6000/rs6000.c: Fix typos. * config/rs6000/vector.md: Fix typos. * config/rx/rx.md: Fix typos. * config/rx/rx.opt: Fix typos. * config/s390/2097.md: Fix typos. * config/s390/s390.c: Fix typos. * config/s390/s390.h: Fix typos. * config/sh/sh.c: Fix typos. * config/sh/sh.md: Fix typos. * config/sparc/sync.md: Fix typos. * config/spu/spu.c: Fix typos. * config/spu/spu.md: Fix typos. * config/vms/vms.c: Fix typos. * config/vxworks-dummy.h: Fix typos. * config/vxworks.h: Fix typos. * cselib.c: Fix typos. * df-scan.c: Fix typos. * df.h: Fix typos. * doc/extend.texi: Fix typos. * doc/install.texi: Fix typos. * doc/invoke.texi: Fix typos. * doc/md.texi: Fix typos. * doc/plugins.texi: Fix typos. * doc/rtl.texi: Fix typos. * dse.c: Fix typos. * dwarf2asm.c: Fix typos. * dwarf2out.c: Fix typos. * except.h: Fix typos. * expr.c: Fix typos. * fold-const.c: Fix typos. * gcc.c: Fix typos. * gcse.c: Fix typos. * genautomata.c: Fix typos. * gengtype-state.c: Fix typos. * gengtype.c: Fix typos. * genhooks.c: Fix typos. * gimple-fold.c: Fix typos. * gimple-pretty-print.c: Fix typos. * gimple.c: Fix typos. * gimple.h: Fix typos. * gimplify.c: Fix typos. * graphite-interchange.c: Fix typos. * graphite-sese-to-poly.c: Fix typos. * ifcvt.c: Fix typos. * input.c: Fix typos. * ipa-cp.c: Fix typos. * ipa-inline-analysis.c: Fix typos. * ipa-inline-transform.c: Fix typos. * ipa-inline.c: Fix typos. * ipa-pure-const.c: Fix typos. * ipa-ref.h: Fix typos. * ipa-reference.c: Fix typos. * ipa-utils.c: Fix typos. * ipa.c: Fix typos. * ira-emit.c: Fix typos. * ira-lives.c: Fix typos. * lto-streamer.c: Fix typos. * lto-streamer.h: Fix typos. * lto-wrapper.c: Fix typos. * mcf.c: Fix typos. * mode-switching.c: Fix typos. * modulo-sched.c: Fix typos. * plugin.c: Fix typos. * postreload.c: Fix typos. * sched-deps.c: Fix typos. * sel-sched-ir.c: Fix typos. * sel-sched-ir.h: Fix typos. * sel-sched.c: Fix typos. * sese.c: Fix typos. * stor-layout.c: Fix typos. * target-hooks-macros.h: Fix typos. * target.def: Fix typos. * trans-mem.c: Fix typos. * tree-eh.c: Fix typos. * tree-predcom.c: Fix typos. * tree-sra.c: Fix typos. * tree-ssa-address.c: Fix typos. * tree-ssa-loop-ivopts.c: Fix typos. * tree-ssa-loop-niter.c: Fix typos. * tree-ssa-math-opts.c: Fix typos. * tree-ssa-pre.c: Fix typos. * tree-ssa-propagate.c: Fix typos. * tree-ssa-reassoc.c: Fix typos. * tree-ssa-sccvn.c: Fix typos. * tree-ssa-ter.c: Fix typos. * tree-ssa-uninit.c: Fix typos. * tree-ssanames.c: Fix typos. * tree-vect-generic.c: Fix typos. * tree-vect-slp.c: Fix typos. * tree.c: Fix typos. * tree.h: Fix typos. * varasm.c: Fix typos. * varpool.c: Fix typos. From-SVN: r187959
2012-05-29 16:14:06 +02:00
up to a max of 8 cycles so that such insns may move from Q -> R.
The description of the hooks are as below:
TARGET_SCHED_INIT_GLOBAL: Added a new target hook in the generic
scheduler; it is called inside the sched_init function just after
find_insn_reg_weights function call. It is used to calculate the SImode
and SFmode weights of insns of basic blocks; much similar to what
find_insn_reg_weights does.
TARGET_SCHED_FINISH_GLOBAL: Corresponding cleanup hook.
TARGET_SCHED_DFA_NEW_CYCLE: Skip cycles if high register pressure is
indicated by TARGET_SCHED_REORDER2; doing this may move insns from
(Q)->(R).
TARGET_SCHED_REORDER: If the register pressure for SImode or SFmode is
high; reorder the ready queue so that the insn with lowest LUID will be
issued next.
TARGET_SCHED_REORDER2: If the register pressure is high, indicate to
TARGET_SCHED_DFA_NEW_CYCLE to skip cycles.
TARGET_SCHED_VARIABLE_ISSUE: Cache the value of can_issue_more so that it
can be returned from TARGET_SCHED_REORDER2.
TARGET_SCHED_INIT: Reset the register pressure counting variables. */
#undef TARGET_SCHED_DFA_NEW_CYCLE
#define TARGET_SCHED_DFA_NEW_CYCLE sh_dfa_new_cycle
#undef TARGET_SCHED_INIT_GLOBAL
#define TARGET_SCHED_INIT_GLOBAL sh_md_init_global
#undef TARGET_SCHED_FINISH_GLOBAL
#define TARGET_SCHED_FINISH_GLOBAL sh_md_finish_global
#undef TARGET_SCHED_VARIABLE_ISSUE
#define TARGET_SCHED_VARIABLE_ISSUE sh_variable_issue
#undef TARGET_SCHED_REORDER
#define TARGET_SCHED_REORDER sh_reorder
#undef TARGET_SCHED_REORDER2
#define TARGET_SCHED_REORDER2 sh_reorder2
#undef TARGET_SCHED_INIT
#define TARGET_SCHED_INIT sh_md_init
#undef TARGET_DELEGITIMIZE_ADDRESS
#define TARGET_DELEGITIMIZE_ADDRESS sh_delegitimize_address
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS sh_legitimize_address
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
#undef TARGET_CANNOT_MODIFY_JUMPS_P
#define TARGET_CANNOT_MODIFY_JUMPS_P sh_cannot_modify_jumps_p
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
#undef TARGET_BRANCH_TARGET_REGISTER_CLASS
#define TARGET_BRANCH_TARGET_REGISTER_CLASS sh_target_reg_class
#undef TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED
#define TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED \
sh_optimize_target_register_callee_saved
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
#undef TARGET_MS_BITFIELD_LAYOUT_P
#define TARGET_MS_BITFIELD_LAYOUT_P sh_ms_bitfield_layout_p
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS sh_init_builtins
#undef TARGET_BUILTIN_DECL
#define TARGET_BUILTIN_DECL sh_builtin_decl
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN sh_expand_builtin
#undef TARGET_FUNCTION_OK_FOR_SIBCALL
#define TARGET_FUNCTION_OK_FOR_SIBCALL sh_function_ok_for_sibcall
#undef TARGET_CANNOT_COPY_INSN_P
#define TARGET_CANNOT_COPY_INSN_P sh_cannot_copy_insn_p
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 sh_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 sh_address_cost
#undef TARGET_ALLOCATE_INITIAL_VALUE
#define TARGET_ALLOCATE_INITIAL_VALUE sh_allocate_initial_value
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
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 sh_reorg
#undef TARGET_DWARF_REGISTER_SPAN
#define TARGET_DWARF_REGISTER_SPAN sh_dwarf_register_span
#ifdef HAVE_AS_TLS
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS true
#endif
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES sh_promote_prototypes
#undef TARGET_PROMOTE_FUNCTION_MODE
#define TARGET_PROMOTE_FUNCTION_MODE sh_promote_function_mode
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
#undef TARGET_FUNCTION_VALUE
#define TARGET_FUNCTION_VALUE sh_function_value
#undef TARGET_FUNCTION_VALUE_REGNO_P
#define TARGET_FUNCTION_VALUE_REGNO_P sh_function_value_regno_p
#undef TARGET_LIBCALL_VALUE
#define TARGET_LIBCALL_VALUE sh_libcall_value
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX sh_struct_value_rtx
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY sh_return_in_memory
#undef TARGET_EXPAND_BUILTIN_SAVEREGS
#define TARGET_EXPAND_BUILTIN_SAVEREGS sh_builtin_saveregs
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS sh_setup_incoming_varargs
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING sh_strict_argument_naming
#undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED sh_pretend_outgoing_varargs_named
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
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE sh_pass_by_reference
function.c (reference_callee_copied): New. * function.c (reference_callee_copied): New. (assign_parm_setup_reg): Use it. * calls.c (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.h (reference_callee_copied): Declare. * target.h (struct gcc_target): Add callee_copies. * target-def.h (TARGET_CALLEE_COPIES): New. (TARGET_PASS_BY_REFERENCE): Update default. * expr.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * targhooks.c (hook_callee_copies_named): New. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Rename from hook_pass_by_reference_false. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): New. * targhooks.h: Update decls. * config/arc/arc.c (TARGET_CALLEE_COPIES): New. * config/arc/arc.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/frv/frv-protos.h (frv_function_arg_callee_copies): Remove. * config/frv/frv.c (frv_function_arg_callee_copies): Remove. * config/frv/frv.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/iq2000/iq2000.c (TARGET_CALLEE_COPIES): New. * config/iq2000/iq2000.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/m68hc11/m68hc11.c (TARGET_CALLEE_COPIES): New. * config/m68hc11/m68hc11.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mips/mips.c (TARGET_CALLEE_COPIES): New. (mips_callee_copies): New. * config/mips/mips.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): New. * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): New. * config/mn10300/mn10300.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/pa/pa.c (TARGET_CALLEE_COPIES): New. * config/pa/pa.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/sh/sh.c (sh_callee_copies): New. (TARGET_CALLEE_COPIES): New. * config/sh/sh.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/v850/v850.c (TARGET_CALLEE_COPIES): New. * config/v850/v850.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * doc/tm.texi (TARGET_CALLEE_COPIES): Replace documentation for FUNCTION_ARG_CALLEE_COPIES. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Update. From-SVN: r87195
2004-09-08 20:45:21 +02:00
#undef TARGET_CALLEE_COPIES
#define TARGET_CALLEE_COPIES sh_callee_copies
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 sh_arg_partial_bytes
#undef TARGET_FUNCTION_ARG
#define TARGET_FUNCTION_ARG sh_function_arg
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE sh_function_arg_advance
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list
re PR middle-end/20983 (varargs functions force va_list variable to stack unnecessarily) PR middle-end/20983 * tree-ssa-ccp.c (optimize_stdarg_builtin): New function. (execute_fold_all_builtins): Call it for BUILT_IN_VA_START, BUILT_IN_VA_COPY and BUILT_IN_VA_END. * target.h (struct ggc_target): Add expand_builtin_va_start hook. * target-def.h (TARGET_EXPAND_BUILTIN_VA_START): Define. (TARGET_INITIALIZER): Add it. * builtins.c (expand_builtin_va_start): Use targetm.expand_builtin_va_start hook instead of EXPAND_BUILTIN_VA_START macro. * alpha/alpha.c (alpha_va_start): Made static. (override_options): Clear targetm.expand_builtin_va_start if TARGET_UNICOSMK. (TARGET_EXPAND_BUILTIN_VA_START): Define. * alpha/unicosmk.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha-protos.h (alpha_va_start): Remove prototype. * xtensa/xtensa.h (EXPAND_BUILTIN_VA_START): Remove. * xtensa/xtensa.c (TARGET_EXPAND_BUILTIN_VA_START): Define. (xtensa_va_start): Made static. * xtensa/xtensa-protos.h (xtensa_va_start): Remove prototype. * pa/pa-protos.h (hppa_va_start): Remove prototype. * pa/pa.h (EXPAND_BUILTIN_VA_START): Remove. * pa/pa.c (hppa_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv.c (frv_expand_builtin_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv-protos.h (frv_expand_builtin_va_start): Remove prototype. * frv/frv.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386.c (override_options): Clear targetm.expand_builtin_va_start if -m32 or 64-bit MS ABI. (ix86_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * i386/i386.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386-protos.h (ix86_va_start, ix86_va_arg): Remove prototypes. * iq2000/iq2000-protos.h (iq2000_va_start): Remove prototype. * iq2000/iq2000.h (EXPAND_BUILTIN_VA_START): Remove. * iq2000/iq2000.c (iq2000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * rs6000/rs6000-protos.h (rs6000_va_start): Remove prototype. * rs6000/rs6000.c (rs6000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. (rs6000_override_options): Clear targetm.expand_builtin_va_start if DEFAULT_ABI != ABI_V4. * rs6000/rs6000.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu.c (spu_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * spu/spu.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu-protos.h spu_va_start): Remove prototype. * stormy16/stormy16.h (EXPAND_BUILTIN_VA_START): Remove. * stormy16/stormy16-protos.h (xstormy16_expand_builtin_va_start): Remove prototype. * stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390-protos.h (s390_va_start): Remove prototype. * s390/s390.c (s390_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300-protos.h (mn10300_va_start): Remove prototype. * mn10300/mn10300.c (mn10300_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.c (arc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.h (EXPAND_BUILTIN_VA_START): Remove. * arc/arc-protos.h (arc_va_start): Remove prototype. * mt/mt-protos.h (mt_va_start): Remove prototype. * sparc/sparc.c (sparc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sparc/sparc-protos.h (sparc_va_start): Remove prototype. * sparc/sparc.h (EXPAND_BUILTIN_VA_START): Remove. * sh/sh.c (sh_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sh/sh-protos.h (sh_va_start): Remove prototype. * sh/sh.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips-protos.h (mips_va_start): Remove prototype. * mips/mips.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips.c (mips_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. From-SVN: r130650
2007-12-06 14:25:37 +01:00
#undef TARGET_EXPAND_BUILTIN_VA_START
#define TARGET_EXPAND_BUILTIN_VA_START sh_va_start
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR sh_gimplify_va_arg_expr
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P sh_scalar_mode_supported_p
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P sh_vector_mode_supported_p
#undef TARGET_CHECK_PCH_TARGET_FLAGS
#define TARGET_CHECK_PCH_TARGET_FLAGS sh_check_pch_target_flags
#undef TARGET_DWARF_CALLING_CONVENTION
#define TARGET_DWARF_CALLING_CONVENTION sh_dwarf_calling_convention
#undef TARGET_FRAME_POINTER_REQUIRED
#define TARGET_FRAME_POINTER_REQUIRED sh_frame_pointer_required
/* Return regmode weight for insn. */
#define INSN_REGMODE_WEIGHT(INSN, MODE)\
regmode_weight[((MODE) == SImode) ? 0 : 1][INSN_UID (INSN)]
/* Return current register pressure for regmode. */
#define CURR_REGMODE_PRESSURE(MODE)\
curr_regmode_pressure[((MODE) == SImode) ? 0 : 1]
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO sh_encode_section_info
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
#undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD sh_secondary_reload
#undef TARGET_PREFERRED_RELOAD_CLASS
#define TARGET_PREFERRED_RELOAD_CLASS sh_preferred_reload_class
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
#undef TARGET_CONDITIONAL_REGISTER_USAGE
#define TARGET_CONDITIONAL_REGISTER_USAGE sh_conditional_register_usage
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P sh_legitimate_address_p
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT sh_trampoline_init
#undef TARGET_TRAMPOLINE_ADJUST_ADDRESS
#define TARGET_TRAMPOLINE_ADJUST_ADDRESS sh_trampoline_adjust_address
target.def (legitimate_constant_p): New hook. gcc/ * target.def (legitimate_constant_p): New hook. * doc/tm.texi.in (LEGITIMATE_CONSTANT_P): Replace with... (TARGET_LEGITIMATE_CONSTANT_P): ...this. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_true): Declare. * hooks.c (hook_bool_mode_rtx_true): Define. * system.h (LEGITIMATE_CONSTANT_P): Poison. * calls.c (precompute_register_parameters): Replace uses of LEGITIMATE_CONSTANT_P with targetm.legitimate_constant_p. (emit_library_call_value_1): Likewise. * expr.c (move_block_to_reg, can_store_by_pieces, emit_move_insn) (compress_float_constant, emit_push_insn, expand_expr_real_1): Likewise. * ira-costs.c (scan_one_insn): Likewise. * recog.c (general_operand, immediate_operand): Likewise. * reload.c (find_reloads_toplev, find_reloads_address_part): Likewise. * reload1.c (init_eliminable_invariants): Likewise. * config/alpha/alpha-protos.h (alpha_legitimate_constant_p): Add a mode argument. * config/alpha/alpha.h (LEGITIMATE_CONSTANT_P): Delete. * config/alpha/alpha.c (alpha_legitimate_constant_p): Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/alpha/predicates.md (input_operand): Update call to alpha_legitimate_constant_p. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Delete. * config/arm/arm.h (ARM_LEGITIMATE_CONSTANT_P): Likewise. (THUMB_LEGITIMATE_CONSTANT_P, LEGITIMATE_CONSTANT_P): Likewise. * config/arm/arm.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (arm_legitimate_constant_p_1, thumb_legitimate_constant_p) (arm_legitimate_constant_p): New functions. (arm_cannot_force_const_mem): Make static. * config/avr/avr.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Delete. * config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin.c (expand_move): Use targetm.legitimate_constant_p instead of bfin_legitimate_constant_p. (bfin_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/cris/cris.h (LEGITIMATE_CONSTANT_P): Delete. * config/fr30/fr30.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_constant_p): Delete. * config/frv/frv.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (frv_legitimate_constant_p): Make static. Add a mode argument. * config/h8300/h8300-protos.h (h8300_legitimate_constant_p): Delete. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/h8300/h8300.c (h8300_legitimate_constant_p): Likewise. * config/i386/i386-protos.h (legitimate_constant_p): Delete. * config/i386/i386.h (LEGITIMATE_CONSTANT_P): Likewise. * config/i386/i386.c (legitimate_constant_p): Rename to... (ix86_legitimate_constant_p): ...this. Make static. Add a mode argument. (ix86_cannot_force_const_mem): Update accordingly. (ix86_legitimate_address_p): Likewise. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/i386/i386.md: Update commentary. * config/ia64/ia64-protos.h (ia64_legitimate_constant_p): Delete. * config/ia64/ia64.h (LEGITIMATE_CONSTANT_P): Likewise. * config/ia64/ia64.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (ia64_legitimate_constant_p): Make static. Add a mode argument. * config/iq2000/iq2000.h (LEGITIMATE_CONSTANT_P): Delete. * config/lm32/lm32-protos.h (lm32_legitimate_constant_p): Delete. * config/lm32/lm32.h (LEGITIMATE_CONSTANT_P): Likewise. * config/lm32/lm32.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (lm32_legitimate_constant_p): Make static. Add a mode argument. * config/m32c/m32c-protos.h (m32c_legitimate_constant_p): Delete. * config/m32c/m32c.h (LEGITIMATE_CONSTANT_P): Likewise. * config/m32c/m32c.c (m32c_legitimate_constant_p): Likewise. * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Delete. * config/m32r/m32r.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (m32r_legitimate_constant_p): New function. * config/m68k/m68k-protos.h (m68k_legitimate_constant_p): Declare. * config/m68k/m68k.h (CONSTANT_ADDRESS_P): Call it instead of LEGITIMATE_CONSTANT_P. (LEGITIMATE_CONSTANT_P): Delete. * config/m68k/m68k.c (m68k_expand_prologue): Call m68k_legitimate_constant_p instead of LEGITIMATE_CONSTANT_P. (m68k_legitimate_constant_p): New function. * config/m68k/m68k.md: Update comments. * config/mcore/mcore.h (LEGITIMATE_CONSTANT_P): Delete. * config/mcore/mcore.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mcore_legitimate_constant_p): New function. * config/mep/mep-protos.h (mep_legitimate_constant_p): Delete. * config/mep/mep.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mep/mep.c (mep_legitimate_constant_p): Make static. Add a mode argument. (mep_legitimate_address): Update accordingly. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/microblaze/microblaze-protos.h (microblaze_const_double_ok): Delete. * config/microblaze/microblaze.h (LEGITIMATE_CONSTANT_P): Likewise. * config/microblaze/microblaze.c (microblaze_const_double_ok): Make static. Check OP's mode for VOIDmode. (microblaze_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Delete. * config/mips/mips.c (mips_legitimate_constant_p): New function. (mips_cannot_force_const_mem): Use it instead of LEGITIMATE_CONSTANT_P. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/predicates.md: Update comments. * config/mmix/mmix-protos.h (mmix_legitimate_constant_p): Delete. * config/mmix/mmix.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mmix/mmix.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mmix_legitimate_constant_p): Make static, return a bool, and take a mode argument. (mmix_print_operand_address): Update accordingly. * config/mn10300/mn10300-protos.h (mn10300_legitimate_constant_p): Delete. * config/mn10300/mn10300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mn10300/mn10300.c (mn10300_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/moxie/moxie.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pa_legitimate_constant_p): New function. * config/picochip/picochip.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pdp11_legitimate_constant_p): New function. * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Delete. * config/rs6000/rs6000.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (rs6000_legitimate_constant_p): New function. * config/rx/rx-protos.h (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. * config/rx/rx.h (LEGITIMATE_CONSTANT_P): Delete. * config/rx/rx.c (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/rx/rx.md (mov<register_modes:mode>): Update accordingly. * config/s390/s390-protos.h (legitimate_constant_p): Delete. * config/s390/s390.h (LEGITIMATE_CONSTANT_P): Likewise. * config/s390/s390.c (legitimate_constant_p): Rename to... (s390_legitimate_constant_p): ...this. Make static, return a bool, and add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/score/score.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (sh_legitimate_constant_p): New function. * config/sparc/sparc-protos.h (legitimate_constant_p): Delete. * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Delete. * config/sparc/sparc.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (legitimate_constant_p): Rename to... (sparc_legitimate_constant_p): ...this. Make static. Add a mode argument. (constant_address_p): Update accordingly. * config/spu/spu-protos.h (spu_legitimate_constant_p): Add a mode argument and return a bool. * config/spu/spu.h (LEGITIMATE_CONSTANT_P): Delete. * config/spu/spu.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (spu_legitimate_constant_p): Add a mode argument and return a bool. (spu_rtx_costs): Update accordingly. * config/spu/predicates.md (vec_imm_operand): Likewise. * config/stormy16/stormy16.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.c (v850_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/vax/vax-protos.h (legitimate_constant_p): Delete. * config/vax/vax.h (LEGITIMATE_CONSTANT_P): Likewise. * config/vax/vax.c (legitimate_constant_p): Likewise. * config/xtensa/xtensa.h (LEGITIMATE_CONSTANT_P): Delete. * config/xtensa/xtensa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (xtensa_legitimate_constant_p): New function. From-SVN: r172814
2011-04-21 11:38:43 +02:00
#undef TARGET_LEGITIMATE_CONSTANT_P
#define TARGET_LEGITIMATE_CONSTANT_P sh_legitimate_constant_p
/* Machine-specific symbol_ref flags. */
#define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0)
/* The tas.b instruction sets the 7th bit in the byte, i.e. 0x80. This value
is used by optabs.c atomic op expansion code as well as in sync.md. */
#undef TARGET_ATOMIC_TEST_AND_SET_TRUEVAL
#define TARGET_ATOMIC_TEST_AND_SET_TRUEVAL 0x80
struct gcc_target targetm = TARGET_INITIALIZER;
1993-06-29 02:10:35 +02:00
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
/* Information on the currently selected atomic model.
This is initialized in sh_option_override. */
static sh_atomic_model selected_atomic_model_;
const sh_atomic_model&
selected_atomic_model (void)
{
return selected_atomic_model_;
}
static sh_atomic_model
parse_validate_atomic_model_option (const char* str)
{
const char* model_names[sh_atomic_model::num_models];
model_names[sh_atomic_model::none] = "none";
model_names[sh_atomic_model::soft_gusa] = "soft-gusa";
model_names[sh_atomic_model::hard_llcs] = "hard-llcs";
model_names[sh_atomic_model::soft_tcb] = "soft-tcb";
model_names[sh_atomic_model::soft_imask] = "soft-imask";
const char* model_cdef_names[sh_atomic_model::num_models];
model_cdef_names[sh_atomic_model::none] = "NONE";
model_cdef_names[sh_atomic_model::soft_gusa] = "SOFT_GUSA";
model_cdef_names[sh_atomic_model::hard_llcs] = "HARD_LLCS";
model_cdef_names[sh_atomic_model::soft_tcb] = "SOFT_TCB";
model_cdef_names[sh_atomic_model::soft_imask] = "SOFT_IMASK";
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
sh_atomic_model ret;
ret.type = sh_atomic_model::none;
ret.name = model_names[sh_atomic_model::none];
ret.cdef_name = model_cdef_names[sh_atomic_model::none];
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
ret.strict = false;
ret.tcb_gbr_offset = -1;
/* Handle empty string as 'none'. */
if (str == NULL || *str == '\0')
return ret;
#define err_ret(...) do { error (__VA_ARGS__); return ret; } while (0)
std::vector<std::string> tokens;
for (std::stringstream ss (str); ss.good (); )
{
tokens.push_back (std::string ());
std::getline (ss, tokens.back (), ',');
}
if (tokens.empty ())
err_ret ("invalid atomic model option");
/* The first token must be the atomic model name. */
{
for (size_t i = 0; i < sh_atomic_model::num_models; ++i)
if (tokens.front () == model_names[i])
{
ret.type = (sh_atomic_model::enum_type)i;
ret.name = model_names[i];
ret.cdef_name = model_cdef_names[i];
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
goto got_mode_name;
}
err_ret ("invalid atomic model name \"%s\"", tokens.front ().c_str ());
got_mode_name:;
}
/* Go through the remaining tokens. */
for (size_t i = 1; i < tokens.size (); ++i)
{
if (tokens[i] == "strict")
ret.strict = true;
else if (tokens[i].find ("gbr-offset=") == 0)
{
std::string offset_str = tokens[i].substr (strlen ("gbr-offset="));
ret.tcb_gbr_offset = integral_argument (offset_str.c_str ());
if (offset_str.empty () || ret.tcb_gbr_offset == -1)
err_ret ("could not parse gbr-offset value \"%s\" in atomic model "
"option", offset_str.c_str ());
}
else
err_ret ("unknown parameter \"%s\" in atomic model option",
tokens[i].c_str ());
}
/* Check that the selection makes sense. */
if (TARGET_SHMEDIA && ret.type != sh_atomic_model::none)
err_ret ("atomic operations are not supported on SHmedia");
if (ret.type == sh_atomic_model::soft_gusa && !TARGET_SH3)
err_ret ("atomic model %s is only available on SH3 and SH4 targets",
ret.name);
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
if (ret.type == sh_atomic_model::hard_llcs && !TARGET_SH4A)
err_ret ("atomic model %s is only available on SH4A targets", ret.name);
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
if (ret.type == sh_atomic_model::soft_tcb && ret.tcb_gbr_offset == -1)
err_ret ("atomic model %s requires gbr-offset parameter", ret.name);
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
if (ret.type == sh_atomic_model::soft_tcb
&& (ret.tcb_gbr_offset < 0 || ret.tcb_gbr_offset > 1020
|| (ret.tcb_gbr_offset & 3) != 0))
err_ret ("invalid gbr-offset value \"%d\" for atomic model %s; it must be "
"a multiple of 4 in the range 0-1020", ret.tcb_gbr_offset,
ret.name);
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
if (ret.type == sh_atomic_model::soft_imask && TARGET_USERMODE)
err_ret ("cannot use atomic model %s in user mode", ret.name);
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
return ret;
#undef err_ret
}
/* Implement TARGET_OPTION_OVERRIDE macro. Validate and override
various options, and do some machine dependent initialization. */
static void
sh_option_override (void)
{
int regno;
SUBTARGET_OVERRIDE_OPTIONS;
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
if (optimize > 1 && !optimize_size)
target_flags |= MASK_SAVE_ALL_TARGET_REGS;
sh_cpu = PROCESSOR_SH1;
assembler_dialect = 0;
if (TARGET_SH2)
sh_cpu = PROCESSOR_SH2;
if (TARGET_SH2E)
sh_cpu = PROCESSOR_SH2E;
if (TARGET_SH2A)
sh_cpu = PROCESSOR_SH2A;
if (TARGET_SH3)
sh_cpu = PROCESSOR_SH3;
if (TARGET_SH3E)
sh_cpu = PROCESSOR_SH3E;
if (TARGET_SH4)
{
assembler_dialect = 1;
sh_cpu = PROCESSOR_SH4;
}
if (TARGET_SH4A_ARCH)
{
assembler_dialect = 1;
sh_cpu = PROCESSOR_SH4A;
}
if (TARGET_SH5)
{
sh_cpu = PROCESSOR_SH5;
target_flags |= MASK_ALIGN_DOUBLE;
if (TARGET_SHMEDIA_FPU)
target_flags |= MASK_FMOVD;
if (TARGET_SHMEDIA)
{
/* There are no delay slots on SHmedia. */
flag_delayed_branch = 0;
/* Relaxation isn't yet supported for SHmedia */
target_flags &= ~MASK_RELAX;
/* After reload, if conversion does little good but can cause
ICEs:
- find_if_block doesn't do anything for SH because we don't
have conditional execution patterns. (We use conditional
move patterns, which are handled differently, and only
before reload).
- find_cond_trap doesn't do anything for the SH because we
don't have conditional traps.
- find_if_case_1 uses redirect_edge_and_branch_force in
the only path that does an optimization, and this causes
an ICE when branch targets are in registers.
- find_if_case_2 doesn't do anything for the SHmedia after
reload except when it can redirect a tablejump - and
that's rather rare. */
flag_if_conversion2 = 0;
if (! strcmp (sh_div_str, "call"))
sh_div_strategy = SH_DIV_CALL;
else if (! strcmp (sh_div_str, "call2"))
sh_div_strategy = SH_DIV_CALL2;
if (! strcmp (sh_div_str, "fp") && TARGET_FPU_ANY)
sh_div_strategy = SH_DIV_FP;
else if (! strcmp (sh_div_str, "inv"))
sh_div_strategy = SH_DIV_INV;
else if (! strcmp (sh_div_str, "inv:minlat"))
sh_div_strategy = SH_DIV_INV_MINLAT;
else if (! strcmp (sh_div_str, "inv20u"))
sh_div_strategy = SH_DIV_INV20U;
else if (! strcmp (sh_div_str, "inv20l"))
sh_div_strategy = SH_DIV_INV20L;
else if (! strcmp (sh_div_str, "inv:call2"))
sh_div_strategy = SH_DIV_INV_CALL2;
else if (! strcmp (sh_div_str, "inv:call"))
sh_div_strategy = SH_DIV_INV_CALL;
else if (! strcmp (sh_div_str, "inv:fp"))
{
if (TARGET_FPU_ANY)
sh_div_strategy = SH_DIV_INV_FP;
else
sh_div_strategy = SH_DIV_INV;
}
TARGET_CBRANCHDI4 = 0;
/* Assembler CFI isn't yet fully supported for SHmedia. */
flag_dwarf2_cfi_asm = 0;
}
}
else
{
/* Only the sh64-elf assembler fully supports .quad properly. */
targetm.asm_out.aligned_op.di = NULL;
targetm.asm_out.unaligned_op.di = NULL;
}
if (TARGET_SH1)
{
if (! strcmp (sh_div_str, "call-div1"))
sh_div_strategy = SH_DIV_CALL_DIV1;
else if (! strcmp (sh_div_str, "call-fp")
&& (TARGET_FPU_DOUBLE
|| (TARGET_HARD_SH4 && TARGET_SH2E)
|| (TARGET_SHCOMPACT && TARGET_FPU_ANY)))
sh_div_strategy = SH_DIV_CALL_FP;
else if (! strcmp (sh_div_str, "call-table") && TARGET_SH2)
sh_div_strategy = SH_DIV_CALL_TABLE;
else
/* Pick one that makes most sense for the target in general.
It is not much good to use different functions depending
on -Os, since then we'll end up with two different functions
when some of the code is compiled for size, and some for
speed. */
/* SH4 tends to emphasize speed. */
if (TARGET_HARD_SH4)
sh_div_strategy = SH_DIV_CALL_TABLE;
/* These have their own way of doing things. */
else if (TARGET_SH2A)
sh_div_strategy = SH_DIV_INTRINSIC;
/* ??? Should we use the integer SHmedia function instead? */
else if (TARGET_SHCOMPACT && TARGET_FPU_ANY)
sh_div_strategy = SH_DIV_CALL_FP;
/* SH1 .. SH3 cores often go into small-footprint systems, so
default to the smallest implementation available. */
else if (TARGET_SH2) /* ??? EXPERIMENTAL */
sh_div_strategy = SH_DIV_CALL_TABLE;
else
sh_div_strategy = SH_DIV_CALL_DIV1;
}
if (!TARGET_SH1)
TARGET_PRETEND_CMOVE = 0;
if (sh_divsi3_libfunc[0])
; /* User supplied - leave it alone. */
else if (TARGET_DIVIDE_CALL_FP)
sh_divsi3_libfunc = "__sdivsi3_i4";
else if (TARGET_DIVIDE_CALL_TABLE)
sh_divsi3_libfunc = "__sdivsi3_i4i";
else if (TARGET_SH5)
sh_divsi3_libfunc = "__sdivsi3_1";
else
sh_divsi3_libfunc = "__sdivsi3";
if (sh_branch_cost == -1)
{
sh_branch_cost = 1;
/* The SH1 does not have delay slots, hence we get a pipeline stall
at every branch. The SH4 is superscalar, so the single delay slot
is not sufficient to keep both pipelines filled. */
if (! TARGET_SH2 || TARGET_HARD_SH4)
sh_branch_cost = 2;
}
/* Set -mzdcbranch for SH4 / SH4A if not otherwise specified by the user. */
if (! global_options_set.x_TARGET_ZDCBRANCH && TARGET_HARD_SH4)
TARGET_ZDCBRANCH = 1;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (! VALID_REGISTER_P (regno))
sh_register_names[regno][0] = '\0';
for (regno = 0; regno < ADDREGNAMES_SIZE; regno++)
if (! VALID_REGISTER_P (ADDREGNAMES_REGNO (regno)))
sh_additional_register_names[regno][0] = '\0';
if ((flag_pic && ! TARGET_PREFERGOT)
|| (TARGET_SHMEDIA && !TARGET_PT_FIXED))
flag_no_function_cse = 1;
tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. * doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation, based on the above, for new target hook. * hooks.c (hook_bool_mode_true): New generic hook. * hooks.h (hook_bool_mode_true): Add prototype. * target.h (struct gcc_target): Add small_register_classes_for_mode_p target hook. * target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default target hook, set to hook_bool_mode_false. * regs.h: Remove default definition of SMALL_REGISTER_CLASSES. * reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES with targetm.small_register_classes_for_mode_p. (find_reusable_reload): Likewise. (combine_reloads): Likewise. * reload1.c (reload_as_needed): Likewise. * cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise. * ifcvt.c (noce_process_if_block, check_cond_move_block, dead_or_predicable): Likewise. * regmove.c (optimize_reg_copy_1): Likewise. * calls.c (prepare_call_address): Likewise. (precompute_register_parameters): Likewise. * config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/sh/sh.c (sh_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small except for SH64. (sh_override_options): Use the new hook. * config/sh/sh-protos.h (sh_small_register_classes_for_mode_p): Add prototype. * config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/arm/arm.c (arm_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for THUMB1. * config/arm/arm-protos.h (arm_small_register_classes_for_mode_p): Add prototype. * config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/mips/mips.c (mips_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for MIPS16. * config/mips/mips-protos.h (mips_small_register_classes_for_mode_p): Add prototype. * config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/m32c/m32c.h: Likewise. * config/pdp11/pdp11.h: Likewise. * config/avr/avr.h: Likewise. * config/xtensa/xtensa.h: Likewise. * config/m68hc11/m68hc11.h: Likewise. * config/mn10300/mn10300.h: Likewise. * config/mcore/mcore.h: Likewise. * config/h8300/h8300.h: Likewise. * config/bfin/bfin.h: Likewise. * config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition. * config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition. From-SVN: r158997
2010-05-03 19:47:47 +02:00
if (targetm.small_register_classes_for_mode_p (VOIDmode)) \
{
/* Never run scheduling before reload, since that can
break global alloc, and generates slower code anyway due
to the pressure on R0. */
/* Enable sched1 for SH4 if the user explicitly requests.
When sched1 is enabled, the ready queue will be reordered by
the target hooks if pressure is high. We can not do this for
PIC, SH3 and lower as they give spill failures for R0. */
if (!TARGET_HARD_SH4 || flag_pic)
flag_schedule_insns = 0;
/* ??? Current exception handling places basic block boundaries
after call_insns. It causes the high pressure on R0 and gives
spill failures for R0 in reload. See PR 22553 and the thread
on gcc-patches
<http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00816.html>. */
else if (flag_exceptions)
{
if (flag_schedule_insns && global_options_set.x_flag_schedule_insns)
warning (0, "ignoring -fschedule-insns because of exception handling bug");
flag_schedule_insns = 0;
}
else if (flag_schedule_insns
&& !global_options_set.x_flag_schedule_insns)
flag_schedule_insns = 0;
}
/* Unwind info is not correct around the CFG unless either a frame
pointer is present or M_A_O_A is set. Fixing this requires rewriting
unwind info generation to be aware of the CFG and propagating states
around edges. */
if ((flag_unwind_tables || flag_asynchronous_unwind_tables
|| flag_exceptions || flag_non_call_exceptions)
&& flag_omit_frame_pointer && !TARGET_ACCUMULATE_OUTGOING_ARGS)
{
warning (0, "unwind tables currently require either a frame pointer "
"or -maccumulate-outgoing-args for correctness");
TARGET_ACCUMULATE_OUTGOING_ARGS = 1;
}
/* Unwinding with -freorder-blocks-and-partition does not work on this
architecture, because it requires far jumps to label crossing between
hot/cold sections which are rejected on this architecture. */
if (flag_reorder_blocks_and_partition)
{
if (flag_exceptions)
{
inform (input_location,
"-freorder-blocks-and-partition does not work with "
"exceptions on this architecture");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
else if (flag_unwind_tables)
{
inform (input_location,
"-freorder-blocks-and-partition does not support unwind "
"info on this architecture");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
}
/* Adjust loop, jump and function alignment values (in bytes), if those
were not specified by the user using -falign-loops, -falign-jumps
and -falign-functions options.
32 bit alignment is better for speed, because instructions can be
fetched as a pair from a longword boundary. For size use 16 bit
alignment to get more compact code.
Aligning all jumps increases the code size, even if it might
result in slightly faster code. Thus, it is set to the smallest
alignment possible if not specified by the user. */
if (align_loops == 0)
{
if (TARGET_SH5)
align_loops = 8;
else
align_loops = optimize_size ? 2 : 4;
}
if (align_jumps == 0)
{
if (TARGET_SHMEDIA)
align_jumps = 1 << CACHE_LOG;
else
align_jumps = 2;
}
else if (align_jumps < (TARGET_SHMEDIA ? 4 : 2))
align_jumps = TARGET_SHMEDIA ? 4 : 2;
if (align_functions == 0)
{
if (TARGET_SHMEDIA)
align_functions = optimize_size
? FUNCTION_BOUNDARY/8 : (1 << CACHE_LOG);
else
align_functions = optimize_size ? 2 : 4;
}
/* The linker relaxation code breaks when a function contains
alignments that are larger than that at the start of a
compilation unit. */
if (TARGET_RELAX)
{
int min_align
= align_loops > align_jumps ? align_loops : align_jumps;
/* Also take possible .long constants / mova tables int account. */
if (min_align < 4)
min_align = 4;
if (align_functions < min_align)
align_functions = min_align;
}
if (flag_unsafe_math_optimizations)
{
/* Enable fsca insn for SH4A if not otherwise specified by the user. */
if (global_options_set.x_TARGET_FSCA == 0 && TARGET_SH4A_FP)
TARGET_FSCA = 1;
/* Enable fsrra insn for SH4A if not otherwise specified by the user. */
if (global_options_set.x_TARGET_FSRRA == 0 && TARGET_SH4A_FP)
TARGET_FSRRA = 1;
}
/* Allow fsrra insn only if -funsafe-math-optimizations and
-ffinite-math-only is enabled. */
TARGET_FSRRA = TARGET_FSRRA
&& flag_unsafe_math_optimizations
&& flag_finite_math_only;
/* If the -mieee option was not explicitly set by the user, turn it on
unless -ffinite-math-only was specified. See also PR 33135. */
if (! global_options_set.x_TARGET_IEEE)
TARGET_IEEE = ! flag_finite_math_only;
if (sh_fixed_range_str)
sh_fix_range (sh_fixed_range_str);
/* This target defaults to strict volatile bitfields. */
if (flag_strict_volatile_bitfields < 0 && abi_version_at_least(2))
flag_strict_volatile_bitfields = 1;
re PR target/52941 (SH Target: Add support for movco.l / movli.l atomics on SH4A) PR target/52941 * config/sh/predicates.md (atomic_arith_operand, atomic_logical_operand): New predicates. * config/sh/sh.c (sh_option_override): Check atomic options. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): New macros. (DRIVER_SELF_SPECS): Use UNSUPPORTED_ATOMIC_OPTIONS and UNSUPPORTED_HARD_ATOMIC_CPU. * config/sh/sync.md: Update description comments. (I12): New mode iterator. (fetchop_predicate, fetchop_constraint): New code attributes. (atomic_compare_and_swapsi_hard, atomic_compare_and_swap<mode>_hard, atomic_exchangesi_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nandsi_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetchsi_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): New insns. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Use same formatting for the first line of the asm block as in new insns above. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_<fetchop_name>_fetch<mode>, atomic_test_and_set): Integrate new *_hard insns into expanders. * config/sh/sh.opt (mhard-atomic): New option. * doc/invoke.texi (SH Options): Document it. From-SVN: r187987
2012-05-29 22:26:41 +02:00
re PR target/50457 (SH2A atomic functions) PR target/50457 * config/sh/sh.opt (matomic-model): New option. (msoft-atomic): Mark as deprecated and alias to matomic-model=soft-gusa. (mhard-atomic): Delete. * config/sh/predicates.md (gbr_displacement): New predicate. * config/sh/sh-protos.h (sh_atomic_model): New struct. (selected_atomic_model): New declaration. (TARGET_ATOMIC_ANY, TARGET_ATOMIC_STRICT, TARGET_ATOMIC_SOFT_GUSA, TARGET_ATOMIC_HARD_LLCS, TARGET_ATOMIC_SOFT_TCB, TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX, TARGET_ATOMIC_SOFT_IMASK): New macros. * config/sh/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Adapt setting to default atomic model. * config/sh/sh.c (selected_atomic_model_): New global variable. (selected_atomic_model, parse_validate_atomic_model_option): New functions. (sh_option_override): Replace atomic selection checks with call to parse_validate_atomic_model_option. * config/sh/sh.h (TARGET_ANY_ATOMIC, UNSUPPORTED_ATOMIC_OPTIONS, UNSUPPORTED_HARD_ATOMIC_CPU): Delete. (DRIVER_SELF_SPECS): Remove atomic checks. config/sh/sync.md: Update documentation comments. (atomic_compare_and_swap<mode>, atomic_exchange<mode>, atomic_fetch_<fetchop_name><mode>, atomic_fetch_nand<mode>, atomic_<fetchop_name>_fetch<mode>, atomic_nand_fetch<mode>): Use TARGET_ATOMIC_ANY as condition. Add TARGET_ATOMIC_STRICT check for SH4A case. Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_test_and_set): Handle new TARGET_ATOMIC_SOFT_TCB and TARGET_ATOMIC_SOFT_IMASK cases. (atomic_compare_and_swapsi_hard, atomic_exchangesi_hard, atomic_fetch_<fetchop_name>si_hard, atomic_fetch_nandsi_hard, atomic_<fetchop_name>_fetchsi_hard, atomic_nand_fetchsi_hard): Add TARGET_ATOMIC_STRICT check. (atomic_compare_and_swap<mode>_hard, atomic_exchange<mode>_hard, atomic_fetch_<fetchop_name><mode>_hard, atomic_fetch_nand<mode>_hard, atomic_<fetchop_name>_fetch<mode>_hard, atomic_nand_fetch<mode>_hard, atomic_test_and_set_hard): Use TARGET_ATOMIC_HARD_LLCS condition. (atomic_compare_and_swap<mode>_soft, atomic_exchange<mode>_soft, atomic_fetch_<fetchop_name><mode>_soft, atomic_fetch_nand<mode>_soft, atomic_<fetchop_name>_fetch<mode>_soft, atomic_nand_fetch<mode>_soft, atomic_test_and_set_soft): Append _gusa to the insn names and use TARGET_ATOMIC_SOFT_GUSA as condition. (atomic_compare_and_swap<mode>_soft_tcb, atomic_exchange<mode>_soft_tcb, atomic_fetch_<fetchop_name><mode>_soft_tcb, atomic_fetch_nand<mode>_soft_tcb, atomic_<fetchop_name>_fetch<mode>_soft_tcb, atomic_nand_fetch<mode>_soft_tcb, atomic_test_and_set_soft_tcb): New insns. (atomic_compare_and_swap<mode>_soft_imask, atomic_exchange<mode>_soft_imask, atomic_fetch_<fetchop_name><mode>_soft_imask, atomic_fetch_nand<mode>_soft_imask, atomic_<fetchop_name>_fetch<mode>_soft_imask, atomic_nand_fetch<mode>_soft_imask, atomic_test_and_set_soft_imask): New insns. * doc/invoke.texi (SH Options): Document new matomic-model option. Remove msoft-atomic and mhard-atomic options. From-SVN: r191899
2012-10-01 10:34:02 +02:00
/* Parse atomic model option and make sure it is valid for the current
target CPU. */
selected_atomic_model_
= parse_validate_atomic_model_option (sh_atomic_model_str);
}
/* Print the operand address in x to the stream. */
1993-04-30 16:29:19 +02:00
static void
sh_print_operand_address (FILE *stream, rtx x)
1993-04-30 16:29:19 +02:00
{
switch (GET_CODE (x))
{
case REG:
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
case SUBREG:
fprintf (stream, "@%s", reg_names[true_regnum (x)]);
1993-04-30 16:29:19 +02:00
break;
1995-04-21 03:19:27 +02:00
1993-04-30 16:29:19 +02:00
case PLUS:
{
rtx base = XEXP (x, 0);
rtx index = XEXP (x, 1);
switch (GET_CODE (index))
{
case CONST_INT:
fprintf (stream, "@(%d,%s)", (int) INTVAL (index),
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
reg_names[true_regnum (base)]);
1993-04-30 16:29:19 +02:00
break;
case REG:
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
case SUBREG:
{
int base_num = true_regnum (base);
int index_num = true_regnum (index);
fprintf (stream, "@(r0,%s)",
reg_names[MAX (base_num, index_num)]);
break;
}
1993-04-30 16:29:19 +02:00
default:
gcc_unreachable ();
1993-04-30 16:29:19 +02:00
}
}
break;
1995-04-21 03:19:27 +02:00
1993-04-30 16:29:19 +02:00
case PRE_DEC:
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
fprintf (stream, "@-%s", reg_names[true_regnum (XEXP (x, 0))]);
1993-04-30 16:29:19 +02:00
break;
case POST_INC:
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
fprintf (stream, "@%s+", reg_names[true_regnum (XEXP (x, 0))]);
1993-04-30 16:29:19 +02:00
break;
default:
x = mark_constant_pool_use (x);
output_addr_const (stream, x);
1993-04-30 16:29:19 +02:00
break;
}
}
/* Print operand x (an rtx) in assembler syntax to file stream
according to modifier code.
1993-06-29 02:10:35 +02:00
'.' print a .s if insn needs delay slot
',' print LOCAL_LABEL_PREFIX
'@' print trap, rte or rts depending upon pragma interruptness
1995-04-21 03:19:27 +02:00
'#' output a nop if there is nothing to put in the delay slot
''' print likelihood suffix (/u for unlikely).
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
'>' print branch target if -fverbose-asm
1995-04-21 03:19:27 +02:00
'O' print a constant without the #
'R' print the LSW of a dp value - changes if in little endian
'S' print the MSW of a dp value - changes if in little endian
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
'T' print the next word of a dp value - same as 'R' in big endian mode.
'M' SHMEDIA: print an `x' if `m' will print `base,index'.
otherwise: print .b / .w / .l / .s / .d suffix if operand is a MEM.
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
'N' print 'r63' if the operand is (const_int 0).
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
'd' print a V2SF reg as dN instead of fpN.
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
'm' print a pair `base,offset' or `base,index', for LD and ST.
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
'U' Likewise for {LD,ST}{HI,LO}.
'V' print the position of a single bit set.
'W' print the position of a single bit cleared.
't' print a memory address which is a register.
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
'u' prints the lowest 16 bits of CONST_INT, as an unsigned value.
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
'o' output an operator. */
1993-04-30 16:29:19 +02:00
static void
sh_print_operand (FILE *stream, rtx x, int code)
1993-04-30 16:29:19 +02:00
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
int regno;
enum machine_mode mode;
1993-04-30 16:29:19 +02:00
switch (code)
{
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
tree trapa_attr;
1993-06-29 02:10:35 +02:00
case '.':
if (final_sequence
&& ! INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0))
&& get_attr_length (XVECEXP (final_sequence, 0, 1)))
fprintf (stream, ASSEMBLER_DIALECT ? "/s" : ".s");
break;
case ',':
fprintf (stream, "%s", LOCAL_LABEL_PREFIX);
1993-06-29 02:10:35 +02:00
break;
case '@':
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
trapa_attr = lookup_attribute ("trap_exit",
DECL_ATTRIBUTES (current_function_decl));
if (trapa_attr)
fprintf (stream, "trapa #%ld",
(long) TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (trapa_attr))));
else if (sh_cfun_interrupt_handler_p ())
{
if (sh_cfun_resbank_handler_p ())
fprintf (stream, "resbank\n");
fprintf (stream, "rte");
}
else
fprintf (stream, "rts");
break;
1993-04-30 16:29:19 +02:00
case '#':
/* Output a nop if there's nothing in the delay slot. */
1993-04-30 16:29:19 +02:00
if (dbr_sequence_length () == 0)
1995-04-21 03:19:27 +02:00
fprintf (stream, "\n\tnop");
1993-04-30 16:29:19 +02:00
break;
case '\'':
{
rtx note = find_reg_note (current_output_insn, REG_BR_PROB, 0);
if (note && INTVAL (XEXP (note, 0)) * 2 < REG_BR_PROB_BASE)
fputs ("/u", stream);
break;
}
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
case '>':
if (flag_verbose_asm && JUMP_LABEL (current_output_insn))
{
fputs ("\t! target: ", stream);
output_addr_const (stream, JUMP_LABEL (current_output_insn));
}
break;
1993-06-29 02:10:35 +02:00
case 'O':
x = mark_constant_pool_use (x);
output_addr_const (stream, x);
1993-04-30 16:29:19 +02:00
break;
/* N.B.: %R / %S / %T adjust memory addresses by four.
For SHMEDIA, that means they can be used to access the first and
second 32 bit part of a 64 bit (or larger) value that
might be held in floating point registers or memory.
While they can be used to access 64 bit parts of a larger value
held in general purpose registers, that won't work with memory -
neither for fp registers, since the frxx names are used. */
1993-04-30 16:29:19 +02:00
case 'R':
if (REG_P (x) || GET_CODE (x) == SUBREG)
{
regno = true_regnum (x);
regno += FP_REGISTER_P (regno) ? 1 : LSW;
fputs (reg_names[regno], (stream));
}
else if (MEM_P (x))
{
x = adjust_address (x, SImode, 4 * LSW);
sh_print_operand_address (stream, XEXP (x, 0));
}
else
{
rtx sub = NULL_RTX;
mode = GET_MODE (x);
if (mode == VOIDmode)
mode = DImode;
if (GET_MODE_SIZE (mode) >= 8)
sub = simplify_subreg (SImode, x, mode, 4 * LSW);
if (sub)
sh_print_operand (stream, sub, 0);
else
output_operand_lossage ("invalid operand to %%R");
}
1995-04-21 03:19:27 +02:00
break;
case 'S':
if (REG_P (x) || GET_CODE (x) == SUBREG)
{
regno = true_regnum (x);
regno += FP_REGISTER_P (regno) ? 0 : MSW;
fputs (reg_names[regno], (stream));
}
else if (MEM_P (x))
{
x = adjust_address (x, SImode, 4 * MSW);
sh_print_operand_address (stream, XEXP (x, 0));
}
else
{
rtx sub = NULL_RTX;
mode = GET_MODE (x);
if (mode == VOIDmode)
mode = DImode;
if (GET_MODE_SIZE (mode) >= 8)
sub = simplify_subreg (SImode, x, mode, 4 * MSW);
if (sub)
sh_print_operand (stream, sub, 0);
else
output_operand_lossage ("invalid operand to %%S");
}
break;
case 'T':
/* Next word of a double. */
1993-04-30 16:29:19 +02:00
switch (GET_CODE (x))
{
case REG:
fputs (reg_names[REGNO (x) + 1], (stream));
break;
case MEM:
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (GET_CODE (XEXP (x, 0)) != PRE_DEC
&& GET_CODE (XEXP (x, 0)) != POST_INC)
x = adjust_address (x, SImode, 4);
sh_print_operand_address (stream, XEXP (x, 0));
1993-04-30 16:29:19 +02:00
break;
default:
break;
1993-04-30 16:29:19 +02:00
}
break;
case 't':
gcc_assert (MEM_P (x));
x = XEXP (x, 0);
switch (GET_CODE (x))
{
case REG:
case SUBREG:
sh_print_operand (stream, x, 0);
break;
default:
break;
}
break;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
case 'o':
switch (GET_CODE (x))
{
case PLUS: fputs ("add", stream); break;
case MINUS: fputs ("sub", stream); break;
case MULT: fputs ("mul", stream); break;
case DIV: fputs ("div", stream); break;
case EQ: fputs ("eq", stream); break;
case NE: fputs ("ne", stream); break;
case GT: case LT: fputs ("gt", stream); break;
case GE: case LE: fputs ("ge", stream); break;
case GTU: case LTU: fputs ("gtu", stream); break;
case GEU: case LEU: fputs ("geu", stream); break;
default:
break;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
break;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
case 'M':
if (TARGET_SHMEDIA)
{
if (MEM_P (x)
&& GET_CODE (XEXP (x, 0)) == PLUS
&& (REG_P (XEXP (XEXP (x, 0), 1))
|| GET_CODE (XEXP (XEXP (x, 0), 1)) == SUBREG))
fputc ('x', stream);
}
else
{
if (MEM_P (x))
{
switch (GET_MODE (x))
{
case QImode: fputs (".b", stream); break;
case HImode: fputs (".w", stream); break;
case SImode: fputs (".l", stream); break;
case SFmode: fputs (".s", stream); break;
case DFmode: fputs (".d", stream); break;
default: gcc_unreachable ();
}
}
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
break;
case 'm':
gcc_assert (MEM_P (x));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
x = XEXP (x, 0);
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* Fall through. */
case 'U':
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
switch (GET_CODE (x))
{
case REG:
case SUBREG:
sh_print_operand (stream, x, 0);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
fputs (", 0", stream);
break;
case PLUS:
sh_print_operand (stream, XEXP (x, 0), 0);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
fputs (", ", stream);
sh_print_operand (stream, XEXP (x, 1), 0);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
break;
default:
gcc_unreachable ();
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
break;
case 'V':
{
int num = exact_log2 (INTVAL (x));
gcc_assert (num >= 0);
fprintf (stream, "#%d", num);
}
break;
case 'W':
{
int num = exact_log2 (~INTVAL (x));
gcc_assert (num >= 0);
fprintf (stream, "#%d", num);
}
break;
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
case 'd':
gcc_assert (REG_P (x) && GET_MODE (x) == V2SFmode);
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
fprintf ((stream), "d%s", reg_names[REGNO (x)] + 1);
break;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
case 'N':
sh-protos.h (binary_float_operator): Remove declaration. * sh-protos.h (binary_float_operator): Remove declaration. (sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare. * sh.c (print_operand, case 'N'): Check against CONST0_RTX. (unary_float_operator, sh_expand_unop_v2sf): New functions. (sh_expand_binop_v2sf): Likewise. (zero_vec_operand): Delete. (SH_BLTIN_UDI): New builtin shared signature define. Renumbered all non-shared ones. (bdesc): Change all the mextr builtins to use SH_BLTIN_UDI. Enable nsb and byterev. * sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS. (HARD_REGNO_MODE_OK): Allow TImode in fp regs. Allow V2SFmode in general regs. (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. Remove clause for immediate operands. (SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands. Add DF_HI_REGS. (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow lowpart fp regs - only for big endian for now. (LEGITIMATE_CONSTANT_P): Don't allow non-zero float vectors when FPU is in use. (EXTRA_CONTRAINT_U): Check against CONST0_RTX. (LOAD_EXTEND_OP): NIL for SImode. (REGISTER_MOVE_COST): Add DF_HI_REGS. Const for moves between general and fp registers is 4. PREDICATE_CODES: Amend binary_float_operator entry. Remove zero_vec_operand. Add unary_float_operator. * sh.md (udivsi3_i4_media): Use truncate instead of paradoxical subreg SET_DEST. (truncdisi2, truncdihi2, movv2sf): Allow memory destinations. (truncdiqi2): Do sign extension. (movsi_media, movdi_media): Allow to use r63 to an fp register. (movdf_media, movsf_media): Likewise. (movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS. Collapse to one define_insn_and_split. Allow immediate sources. (addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns. (movv4sf_i): Allow immediate sources. Use simplify_gen_subreg. (movv4sf): Allow immediate sources. (movsf_media_nofpu+1): Don't split moves to FP registers. (unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns. (movv8qi_i+3): Check against CONST0_RTX. (mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode for input and output operands. Fix argument 3 to gen_mextr_rl. (mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/ (msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise. (mshf0_w, fipr, ftrv): Likewise. (mshfhi_l_di): Now insn_and_split. Can handle FP regs. From-SVN: r55528
2002-07-17 17:15:04 +02:00
if (x == CONST0_RTX (GET_MODE (x)))
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{
fprintf ((stream), "r63");
break;
}
goto default_output;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
case 'u':
if (CONST_INT_P (x))
{
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
fprintf ((stream), "%u", (unsigned) INTVAL (x) & (0x10000 - 1));
break;
}
/* Fall through. */
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
default_output:
1993-04-30 16:29:19 +02:00
default:
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
regno = 0;
mode = GET_MODE (x);
1993-04-30 16:29:19 +02:00
switch (GET_CODE (x))
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
case TRUNCATE:
{
rtx inner = XEXP (x, 0);
int offset = 0;
enum machine_mode inner_mode;
/* We might see SUBREGs with vector mode registers inside. */
if (GET_CODE (inner) == SUBREG
&& (GET_MODE_SIZE (GET_MODE (inner))
== GET_MODE_SIZE (GET_MODE (SUBREG_REG (inner))))
&& subreg_lowpart_p (inner))
inner = SUBREG_REG (inner);
if (CONST_INT_P (inner))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{
x = GEN_INT (trunc_int_for_mode (INTVAL (inner), GET_MODE (x)));
goto default_output;
}
inner_mode = GET_MODE (inner);
if (GET_CODE (inner) == SUBREG
&& (GET_MODE_SIZE (GET_MODE (inner))
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (inner))))
&& REG_P (SUBREG_REG (inner)))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{
offset = subreg_regno_offset (REGNO (SUBREG_REG (inner)),
GET_MODE (SUBREG_REG (inner)),
SUBREG_BYTE (inner),
GET_MODE (inner));
inner = SUBREG_REG (inner);
}
if (!REG_P (inner) || GET_MODE_SIZE (inner_mode) > 8)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
abort ();
/* Floating point register pairs are always big endian;
general purpose registers are 64 bit wide. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
regno = REGNO (inner);
regno = (HARD_REGNO_NREGS (regno, inner_mode)
- HARD_REGNO_NREGS (regno, mode))
+ offset;
x = inner;
goto reg;
}
case SIGN_EXTEND:
x = XEXP (x, 0);
goto reg;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* FIXME: We need this on SHmedia32 because reload generates
some sign-extended HI or QI loads into DImode registers
but, because Pmode is SImode, the address ends up with a
subreg:SI of the DImode register. Maybe reload should be
fixed so as to apply alter_subreg to such loads? */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
case IF_THEN_ELSE:
gcc_assert (trapping_target_operand (x, VOIDmode));
x = XEXP (XEXP (x, 2), 0);
goto default_output;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
case SUBREG:
gcc_assert (SUBREG_BYTE (x) == 0
&& REG_P (SUBREG_REG (x)));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
x = SUBREG_REG (x);
/* Fall through. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
reg:
1993-04-30 16:29:19 +02:00
case REG:
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
regno += REGNO (x);
if (FP_REGISTER_P (regno)
&& mode == V16SFmode)
fprintf ((stream), "mtrx%s", reg_names[regno] + 2);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
else if (FP_REGISTER_P (REGNO (x))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
&& mode == V4SFmode)
fprintf ((stream), "fv%s", reg_names[regno] + 2);
else if (REG_P (x)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
&& mode == V2SFmode)
fprintf ((stream), "fp%s", reg_names[regno] + 2);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
else if (FP_REGISTER_P (REGNO (x))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
&& GET_MODE_SIZE (mode) > 4)
fprintf ((stream), "d%s", reg_names[regno] + 1);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
else
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
fputs (reg_names[regno], (stream));
1993-04-30 16:29:19 +02:00
break;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
1993-04-30 16:29:19 +02:00
case MEM:
output_address (XEXP (x, 0));
break;
1993-04-30 16:29:19 +02:00
default:
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH1)
fputc ('#', stream);
1993-04-30 16:29:19 +02:00
output_addr_const (stream, x);
break;
}
break;
}
}
static bool
sh_print_operand_punct_valid_p (unsigned char code)
{
return (code == '.' || code == '#' || code == '@' || code == ','
|| code == '$' || code == '\'' || code == '>');
}
/* Implement TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA. */
static bool
sh_asm_output_addr_const_extra (FILE *file, rtx x)
{
if (GET_CODE (x) == UNSPEC)
{
switch (XINT (x, 1))
{
case UNSPEC_DATALABEL:
fputs ("datalabel ", file);
output_addr_const (file, XVECEXP (x, 0, 0));
break;
case UNSPEC_PIC:
/* GLOBAL_OFFSET_TABLE or local symbols, no suffix. */
output_addr_const (file, XVECEXP (x, 0, 0));
break;
case UNSPEC_GOT:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("@GOT", file);
break;
case UNSPEC_GOTOFF:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("@GOTOFF", file);
break;
case UNSPEC_PLT:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("@PLT", file);
break;
case UNSPEC_GOTPLT:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("@GOTPLT", file);
break;
case UNSPEC_DTPOFF:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("@DTPOFF", file);
break;
case UNSPEC_GOTTPOFF:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("@GOTTPOFF", file);
break;
case UNSPEC_TPOFF:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("@TPOFF", file);
break;
case UNSPEC_CALLER:
{
char name[32];
/* LPCS stands for Label for PIC Call Site. */
targetm.asm_out.generate_internal_label (name, "LPCS",
INTVAL (XVECEXP (x, 0, 0)));
assemble_name (file, name);
}
break;
case UNSPEC_EXTRACT_S16:
case UNSPEC_EXTRACT_U16:
{
rtx val, shift;
val = XVECEXP (x, 0, 0);
shift = XVECEXP (x, 0, 1);
fputc ('(', file);
if (shift != const0_rtx)
fputc ('(', file);
if (GET_CODE (val) == CONST
|| GET_RTX_CLASS (GET_CODE (val)) != RTX_OBJ)
{
fputc ('(', file);
output_addr_const (file, val);
fputc (')', file);
}
else
output_addr_const (file, val);
if (shift != const0_rtx)
{
fputs (" >> ", file);
output_addr_const (file, shift);
fputc (')', file);
}
fputs (" & 65535)", file);
}
break;
case UNSPEC_SYMOFF:
output_addr_const (file, XVECEXP (x, 0, 0));
fputc ('-', file);
if (GET_CODE (XVECEXP (x, 0, 1)) == CONST)
{
fputc ('(', file);
output_addr_const (file, XVECEXP (x, 0, 1));
fputc (')', file);
}
else
output_addr_const (file, XVECEXP (x, 0, 1));
break;
case UNSPEC_PCREL_SYMOFF:
output_addr_const (file, XVECEXP (x, 0, 0));
fputs ("-(", file);
output_addr_const (file, XVECEXP (x, 0, 1));
fputs ("-.)", file);
break;
default:
return false;
}
return true;
}
else
return false;
}
1993-04-30 16:29:19 +02:00
/* Encode symbol attributes of a SYMBOL_REF into its
SYMBOL_REF_FLAGS. */
static void
sh_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
if (TREE_CODE (decl) == FUNCTION_DECL
&& sh2a_function_vector_p (decl) && TARGET_SH2A)
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_FUNCVEC_FUNCTION;
}
/* Like force_operand, but guarantees that VALUE ends up in TARGET. */
static void
force_into (rtx value, rtx target)
{
value = force_operand (value, target);
if (! rtx_equal_p (value, target))
emit_insn (gen_move_insn (target, value));
}
/* Emit code to perform a block move. Choose the best method.
OPERANDS[0] is the destination.
OPERANDS[1] is the source.
OPERANDS[2] is the size.
OPERANDS[3] is the alignment safe to use. */
bool
expand_block_move (rtx *operands)
{
int align = INTVAL (operands[3]);
int constp = (CONST_INT_P (operands[2]));
int bytes = (constp ? INTVAL (operands[2]) : 0);
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
if (! constp)
return false;
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
/* If we could use mov.l to move words and dest is word-aligned, we
can use movua.l for loads and still generate a relatively short
and efficient sequence. */
if (TARGET_SH4A_ARCH && align < 4
&& MEM_ALIGN (operands[0]) >= 32
&& can_move_by_pieces (bytes, 32))
{
rtx dest = copy_rtx (operands[0]);
rtx src = copy_rtx (operands[1]);
/* We could use different pseudos for each copied word, but
since movua can only load into r0, it's kind of
pointless. */
rtx temp = gen_reg_rtx (SImode);
rtx src_addr = copy_addr_to_reg (XEXP (src, 0));
int copied = 0;
while (copied + 4 <= bytes)
{
rtx to = adjust_address (dest, SImode, copied);
rtx from = adjust_automodify_address (src, BLKmode,
src_addr, copied);
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
rtl.texi (MEM_SIZE_KNOWN_P): Document. gcc/ * doc/rtl.texi (MEM_SIZE_KNOWN_P): Document. (MEM_SIZE): Change from returning an rtx to returning a HOST_WIDE_INT. * rtl.h (MEM_SIZE_KNOWN_P): New macro. (MEM_SIZE): Return a HOST_WIDE_INT rather than an rtx. * emit-rtl.h (set_mem_size): Take a HOST_WIDE_INT rather than an rtx. (clear_mem_size): Declare. * emit-rtl.c (set_mem_size): Take a HOST_WIDE_INT rather than an rtx. (clear_mem_size): New function. * alias.c (ao_ref_from_mem): Adjust uses of MEM_SIZE, using MEM_SIZE_KNOWN_P to test whether the size is known, and MEM_SIZE to get a HOST_WIDE_INT size. Adjust calls to set_mem_size, passing a HOST_WIDE_INT rather than an rtx. Use clear_mem_size to clear the size. (nonoverlapping_memrefs_p): Likewise. * builtins.c (get_memory_rtx, expand_builtin_memcmp): Likewise. (expand_builtin_init_trampoline): Likewise. * calls.c (compute_argument_addresses): Likewise. * cfgcleanup.c (merge_memattrs): Likewise. * dce.c (find_call_stack_args): Likewise. * dse.c (record_store, scan_insn): Likewise. * dwarf2out.c (dw_sra_loc_expr): Likewise. * expr.c (emit_block_move_hints): Likewise. * function.c (assign_parm_find_stack_rtl): Likewise. * print-rtl.c (print_rtx): Likewise. * reload.c (find_reloads_subreg_address): Likewise. * rtlanal.c (may_trap_p_1): Likewise. * var-tracking.c (track_expr_p): Likewise. * varasm.c (assemble_trampoline_template): Likewise. * config/arm/arm.c (arm_print_operand): Likewise. * config/h8300/h8300.c (h8sx_emit_movmd): Likewise. * config/i386/i386.c (expand_movmem_via_rep_mov): Likewise. (expand_setmem_via_rep_stos, expand_constant_movmem_prologue) (expand_constant_setmem_prologue): Likewise. * config/mips/mips.c (mips_get_unaligned_mem): Likewise. * config/rs6000/rs6000.c (expand_block_move): Likewise. (adjacent_mem_locations): Likewise. * config/s390/s390.c (s390_expand_setmem): Likewise. (s390_expand_insv): Likewise. * config/s390/s390.md (*extzv<mode>, *extv<mode>): Likewise. (*extendqi<mode>2_short_displ): Likewise. * config/sh/sh.c (expand_block_move): Likewise. * config/sh/sh.md (extv, extzv): Likewise. From-SVN: r176476
2011-07-19 19:43:15 +02:00
set_mem_size (from, 4);
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
emit_insn (gen_movua (temp, from));
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
emit_move_insn (src_addr, plus_constant (Pmode, src_addr, 4));
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
emit_move_insn (to, temp);
copied += 4;
}
if (copied < bytes)
move_by_pieces (adjust_address (dest, BLKmode, copied),
adjust_automodify_address (src, BLKmode,
src_addr, copied),
bytes - copied, align, 0);
return true;
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
}
1995-04-21 03:19:27 +02:00
/* If it isn't a constant number of bytes, or if it doesn't have 4 byte
alignment, or if it isn't a multiple of 4 bytes, then fail. */
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
if (align < 4 || (bytes % 4 != 0))
return false;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (TARGET_HARD_SH4)
{
if (bytes < 12)
return false;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
else if (bytes == 12)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
rtx func_addr_rtx = gen_reg_rtx (Pmode);
rtx r4 = gen_rtx_REG (SImode, 4);
rtx r5 = gen_rtx_REG (SImode, 5);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (func_addr_rtx, "__movmemSI12_i4", SFUNC_STATIC);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
emit_insn (gen_block_move_real_i4 (func_addr_rtx));
return true;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
else if (! optimize_size)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
const char *entry_name;
rtx func_addr_rtx = gen_reg_rtx (Pmode);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
int dwords;
rtx r4 = gen_rtx_REG (SImode, 4);
rtx r5 = gen_rtx_REG (SImode, 5);
rtx r6 = gen_rtx_REG (SImode, 6);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
entry_name = (bytes & 4 ? "__movmem_i4_odd" : "__movmem_i4_even");
function_symbol (func_addr_rtx, entry_name, SFUNC_STATIC);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
dwords = bytes >> 3;
emit_insn (gen_move_insn (r6, GEN_INT (dwords - 1)));
emit_insn (gen_block_lump_real_i4 (func_addr_rtx));
return true;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
else
return false;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
1995-04-21 03:19:27 +02:00
if (bytes < 64)
{
char entry[30];
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
rtx func_addr_rtx = gen_reg_rtx (Pmode);
rtx r4 = gen_rtx_REG (SImode, 4);
rtx r5 = gen_rtx_REG (SImode, 5);
1995-04-21 03:19:27 +02:00
builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. gcc/ChangeLog: * builtins.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. * expr.c: Likewise. * expr.h: Likewise. * genopinit.c: Likewise. * integrate.c: Likewise. * local-alloc.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * config/alpha/alpha.h: Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm-protos.h: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.md: Likewise. * config/c4x/c4x.c: Likewise. * config/c4x/c4x.md: Likewise. * config/frv/frv.md: Likewise. * config/i386/i386-protos.h: Likewise. * config/i386/i386.c: Likewise. * config/i386/i386.h: Likewise. * config/i386/i386.md: Likewise. * config/i860/i860.c: Likewise. * config/i860/i860.md: Likewise. * config/ip2k/ip2k.md: Likewise. * config/ip2k/libgcc.S: Likewise. * config/ip2k/t-ip2k: Likewise. * config/m32r/m32r.c: Likewise. * config/m32r/m32r.md: Likewise. * config/mcore/mcore.md: Likewise. * config/mips/mips.c: Likewise. * config/mips/mips.md: Likewise. * config/ns32k/ns32k.c: Likewise. * config/ns32k/ns32k.h: Likewise. * config/ns32k/ns32k.md: Likewise. * config/pa/pa.c: Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.h: Likewise. * config/pdp11/pdp11.md: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rs6000/rs6000.md: Likewise. * config/s390/s390-protos.h: Likewise. * config/s390/s390.c: Likewise. * config/s390/s390.md: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/t-sh: Likewise. * config/sparc/sparc.h: Likewise. * config/vax/vax.md: Likewise. * config/xtensa/xtensa.c: Likewise. * config/xtensa/xtensa.md: Likewise. * doc/invoke.texi: Likewise. * doc/md.texi: Likewise. * doc/rtl.texi: Likewise. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/builtins/mempcpy-2.c: Rename movstr*, except for movstrict*, to movmem* and clrstr* to clrmem*. From-SVN: r84222
2004-07-07 21:25:01 +02:00
sprintf (entry, "__movmemSI%d", bytes);
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (func_addr_rtx, entry, SFUNC_STATIC);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
emit_insn (gen_block_move_real (func_addr_rtx));
return true;
}
1995-04-21 03:19:27 +02:00
/* This is the same number of bytes as a memcpy call, but to a different
less common function name, so this will occasionally use more space. */
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
if (! optimize_size)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
rtx func_addr_rtx = gen_reg_rtx (Pmode);
1995-04-21 03:19:27 +02:00
int final_switch, while_loop;
rtx r4 = gen_rtx_REG (SImode, 4);
rtx r5 = gen_rtx_REG (SImode, 5);
rtx r6 = gen_rtx_REG (SImode, 6);
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (func_addr_rtx, "__movmem", SFUNC_STATIC);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
1995-04-21 03:19:27 +02:00
/* r6 controls the size of the move. 16 is decremented from it
for each 64 bytes moved. Then the negative bit left over is used
as an index into a list of move instructions. e.g., a 72 byte move
would be set up with size(r6) = 14, for one iteration through the
big while loop, and a switch of -2 for the last part. */
1995-04-21 03:19:27 +02:00
final_switch = 16 - ((bytes / 4) % 16);
while_loop = ((bytes / 4) / 16 - 1) * 16;
emit_insn (gen_move_insn (r6, GEN_INT (while_loop + final_switch)));
emit_insn (gen_block_lump_real (func_addr_rtx));
return true;
}
return false;
}
1993-04-30 16:29:19 +02:00
/* Prepare operands for a move define_expand; specifically, one of the
1995-04-21 03:19:27 +02:00
operands must be in a register. */
1993-04-30 16:29:19 +02:00
void
prepare_move_operands (rtx operands[], enum machine_mode mode)
1993-04-30 16:29:19 +02:00
{
if ((mode == SImode || mode == DImode)
&& flag_pic
&& ! ((mode == Pmode || mode == ptr_mode)
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
&& tls_symbolic_operand (operands[1], Pmode) != TLS_MODEL_NONE))
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
{
rtx temp;
if (SYMBOLIC_CONST_P (operands[1]))
{
if (MEM_P (operands[0]))
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
operands[1] = force_reg (Pmode, operands[1]);
else if (TARGET_SHMEDIA
&& GET_CODE (operands[1]) == LABEL_REF
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
&& target_reg_operand (operands[0], mode))
/* It's ok. */;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
else
{
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
temp = (!can_create_pseudo_p ()
? operands[0]
: gen_reg_rtx (Pmode));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
operands[1] = legitimize_pic_address (operands[1], mode, temp);
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
}
}
else if (GET_CODE (operands[1]) == CONST
&& GET_CODE (XEXP (operands[1], 0)) == PLUS
&& SYMBOLIC_CONST_P (XEXP (XEXP (operands[1], 0), 0)))
{
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
temp = !can_create_pseudo_p () ? operands[0] : gen_reg_rtx (Pmode);
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
temp = legitimize_pic_address (XEXP (XEXP (operands[1], 0), 0),
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
mode, temp);
operands[1] = expand_binop (mode, add_optab, temp,
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
XEXP (XEXP (operands[1], 0), 1),
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
(!can_create_pseudo_p ()
? temp
: gen_reg_rtx (Pmode)),
0, OPTAB_LIB_WIDEN);
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
}
}
if (! reload_in_progress && ! reload_completed)
{
/* Copy the source to a register if both operands aren't registers. */
if (! register_operand (operands[0], mode)
&& ! sh_register_operand (operands[1], mode))
operands[1] = copy_to_mode_reg (mode, operands[1]);
if (MEM_P (operands[0]) && ! memory_operand (operands[0], mode))
{
/* This is like change_address_1 (operands[0], mode, 0, 1) ,
except that we can't use that function because it is static. */
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 new_rtx = change_address (operands[0], mode, 0);
MEM_COPY_ATTRIBUTES (new_rtx, operands[0]);
operands[0] = new_rtx;
}
/* This case can happen while generating code to move the result
of a library call to the target. Reject `st r0,@(rX,rY)' because
reload will fail to find a spill register for rX, since r0 is already
being used for the source. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
else if (TARGET_SH1
&& refers_to_regno_p (R0_REG, R0_REG + 1, operands[1], (rtx *)0)
&& MEM_P (operands[0])
&& GET_CODE (XEXP (operands[0], 0)) == PLUS
&& REG_P (XEXP (XEXP (operands[0], 0), 1)))
operands[1] = copy_to_mode_reg (mode, operands[1]);
}
1995-04-21 03:19:27 +02:00
if (mode == Pmode || mode == ptr_mode)
{
rtx op0, op1, opc;
enum tls_model tls_kind;
op0 = operands[0];
op1 = operands[1];
if (GET_CODE (op1) == CONST
&& GET_CODE (XEXP (op1, 0)) == PLUS
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
&& (tls_symbolic_operand (XEXP (XEXP (op1, 0), 0), Pmode)
!= TLS_MODEL_NONE))
{
opc = XEXP (XEXP (op1, 0), 1);
op1 = XEXP (XEXP (op1, 0), 0);
}
else
opc = NULL_RTX;
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
if ((tls_kind = tls_symbolic_operand (op1, Pmode)) != TLS_MODEL_NONE)
{
rtx tga_op1, tga_ret, tmp, tmp2;
if (! flag_pic
&& (tls_kind == TLS_MODEL_GLOBAL_DYNAMIC
|| tls_kind == TLS_MODEL_LOCAL_DYNAMIC
|| tls_kind == TLS_MODEL_INITIAL_EXEC))
{
/* Don't schedule insns for getting GOT address when
the first scheduling is enabled, to avoid spill
failures for R0. */
if (flag_schedule_insns)
emit_insn (gen_blockage ());
emit_insn (gen_GOTaddr2picreg ());
emit_use (gen_rtx_REG (SImode, PIC_REG));
if (flag_schedule_insns)
emit_insn (gen_blockage ());
}
switch (tls_kind)
{
case TLS_MODEL_GLOBAL_DYNAMIC:
tga_ret = gen_rtx_REG (Pmode, R0_REG);
emit_call_insn (gen_tls_global_dynamic (tga_ret, op1));
tmp = gen_reg_rtx (Pmode);
emit_move_insn (tmp, tga_ret);
op1 = tmp;
break;
case TLS_MODEL_LOCAL_DYNAMIC:
tga_ret = gen_rtx_REG (Pmode, R0_REG);
emit_call_insn (gen_tls_local_dynamic (tga_ret, op1));
tmp = gen_reg_rtx (Pmode);
emit_move_insn (tmp, tga_ret);
if (register_operand (op0, Pmode))
tmp2 = op0;
else
tmp2 = gen_reg_rtx (Pmode);
emit_insn (gen_symDTPOFF2reg (tmp2, op1, tmp));
op1 = tmp2;
break;
case TLS_MODEL_INITIAL_EXEC:
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
tga_op1 = !can_create_pseudo_p () ? op0 : gen_reg_rtx (Pmode);
tmp = gen_sym2GOTTPOFF (op1);
emit_insn (gen_tls_initial_exec (tga_op1, tmp));
op1 = tga_op1;
break;
case TLS_MODEL_LOCAL_EXEC:
tmp2 = gen_reg_rtx (Pmode);
emit_insn (gen_store_gbr (tmp2));
tmp = gen_reg_rtx (Pmode);
emit_insn (gen_symTPOFF2reg (tmp, op1));
if (register_operand (op0, Pmode))
op1 = op0;
else
op1 = gen_reg_rtx (Pmode);
emit_insn (gen_addsi3 (op1, tmp, tmp2));
break;
default:
gcc_unreachable ();
}
if (opc)
emit_insn (gen_addsi3 (op1, op1, force_reg (SImode, opc)));
operands[1] = op1;
}
}
1995-04-21 03:19:27 +02:00
}
/* Implement the CANONICALIZE_COMPARISON macro for the combine pass.
This function is also re-used to canonicalize comparisons in cbranch
pattern expanders. */
void
sh_canonicalize_comparison (enum rtx_code& cmp, rtx& op0, rtx& op1,
enum machine_mode mode)
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
/* When invoked from within the combine pass the mode is not specified,
so try to get it from one of the operands. */
if (mode == VOIDmode)
mode = GET_MODE (op0);
if (mode == VOIDmode)
mode = GET_MODE (op1);
// We need to have a mode to do something useful here.
if (mode == VOIDmode)
return;
// Currently, we don't deal with floats here.
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
return;
// Make sure that the constant operand is the second operand.
if (CONST_INT_P (op0) && !CONST_INT_P (op1))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
std::swap (op0, op1);
cmp = swap_condition (cmp);
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
}
if (CONST_INT_P (op1))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
/* Try to adjust the constant operand in such a way that available
comparison insns can be utilized better and the constant can be
loaded with a 'mov #imm,Rm' insn. This avoids a load from the
constant pool. */
const HOST_WIDE_INT val = INTVAL (op1);
/* x > -1 --> x >= 0
x > 0xFFFFFF7F --> x >= 0xFFFFFF80
x <= -1 --> x < 0
x <= 0xFFFFFF7F --> x < 0xFFFFFF80 */
if ((val == -1 || val == -0x81) && (cmp == GT || cmp == LE))
{
cmp = cmp == GT ? GE : LT;
op1 = gen_int_mode (val + 1, mode);
}
/* x >= 1 --> x > 0
x >= 0x80 --> x > 0x7F
x < 1 --> x <= 0
x < 0x80 --> x <= 0x7F */
else if ((val == 1 || val == 0x80) && (cmp == GE || cmp == LT))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
cmp = cmp == GE ? GT : LE;
op1 = gen_int_mode (val - 1, mode);
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
}
/* unsigned x >= 1 --> x != 0
unsigned x < 1 --> x == 0 */
else if (val == 1 && (cmp == GEU || cmp == LTU))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
cmp = cmp == GEU ? NE : EQ;
op1 = CONST0_RTX (mode);
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
}
/* unsigned x >= 0x80 --> unsigned x > 0x7F
unsigned x < 0x80 --> unsigned x < 0x7F */
else if (val == 0x80 && (cmp == GEU || cmp == LTU))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
cmp = cmp == GEU ? GTU : LEU;
op1 = gen_int_mode (val - 1, mode);
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
}
/* unsigned x > 0 --> x != 0
unsigned x <= 0 --> x == 0 */
else if (val == 0 && (cmp == GTU || cmp == LEU))
cmp = cmp == GTU ? NE : EQ;
/* unsigned x > 0x7FFFFFFF --> signed x < 0
unsigned x <= 0x7FFFFFFF --> signed x >= 0 */
else if (mode == SImode && (cmp == GTU || cmp == LEU)
&& val == 0x7FFFFFFF)
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
cmp = cmp == GTU ? LT : GE;
op1 = const0_rtx;
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
}
/* unsigned x >= 0x80000000 --> signed x < 0
unsigned x < 0x80000000 --> signed x >= 0 */
else if (mode == SImode && (cmp == GEU || cmp == LTU)
&& (unsigned HOST_WIDE_INT)val
== ((unsigned HOST_WIDE_INT)0x7FFFFFFF + 1))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
cmp = cmp == GEU ? LT : GE;
op1 = const0_rtx;
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
}
}
}
enum rtx_code
prepare_cbranch_operands (rtx *operands, enum machine_mode mode,
enum rtx_code comparison)
{
/* The scratch reg is only available when this is invoked from within
the cbranchdi4_i splitter, through expand_cbranchdi4. */
rtx scratch = NULL_RTX;
if (comparison == LAST_AND_UNUSED_RTX_CODE)
comparison = GET_CODE (operands[0]);
else
scratch = operands[4];
sh_canonicalize_comparison (comparison, operands[1], operands[2], mode);
/* Notice that this function is also invoked after reload by
the cbranchdi4_i pattern, through expand_cbranchdi4. */
rtx op1 = operands[1];
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
if (can_create_pseudo_p ())
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
operands[1] = force_reg (mode, op1);
/* When we are handling DImode comparisons, we want to keep constants so
that we can optimize the component comparisons; however, memory loads
are better issued as a whole so that they can be scheduled well.
SImode equality comparisons allow I08 constants, but only when they
compare r0. Hence, if operands[1] has to be loaded from somewhere else
into a register, that register might as well be r0, and we allow the
constant. If it is already in a register, this is likely to be
allocated to a different hard register, thus we load the constant into
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
a register unless it is zero. */
if (!REG_P (operands[2])
&& (!CONST_INT_P (operands[2])
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
|| (mode == SImode && operands[2] != CONST0_RTX (SImode)
&& ((comparison != EQ && comparison != NE)
|| (REG_P (op1) && REGNO (op1) != R0_REG)
constraints.md: New file. * config/sh/constraints.md: New file. * config/sh/sh.c: Include tm-constrs.h. (reg_class_from_letter): Remove. (prepare_cbranch_operands): Use satisfies_constraint_* function instead of macro. (andcosts, broken_move, sh_secondary_reload): Likewise. * config/sh/predicates.md (trapping_target_operand): Likewise. (and_operand, arith_operand, arith_reg_or_0_operand, cmp_operand, logical_operand, target_operand, ua_address_operand, ua_offset, xor_operand): Likewise. * config/sh/sh.md: Include constraints.md. (*movsicc_t_false): Use satisfies_constraint_* function instead of macro. (*movsicc_t_true, ashlsi3_std, ashlhi3_k, lshrsi3_m, lshrsi3_k, movsi_const_16bit+2, *movhi_media+1, movdi_const_16bit+1, beq, bne, *ptb): Likewise. * config/sh/sh.h (reg_class_from_letter): Remove prototype. (OVERRIDE_OPTIONS): Don't modify reg_class_from_letter. (REG_CLASS_FROM_CONSTRAINT): Remove. (CONSTRAINT_LEN, CONST_OK_FOR_I20, CONST_OK_FOR_I, CONST_OK_FOR_J, CONST_OK_FOR_K16, CONST_OK_FOR_K, CONST_OK_FOR_P27, CONST_OK_FOR_P, CONST_OK_FOR_M, CONST_OK_FOR_N, CONST_OK_FOR_CONSTRAINT_P, CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. (SECONDARY_INOUT_RELOAD_CLASS): Use satisfies_constraint_* function instead of macro. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (EXTRA_CONSTRAINT_Q, EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc, EXTRA_CONSTRAINT_B, EXTRA_CONSTRAINT_Css, EXTRA_CONSTRAINT_Csu): Remove. (IS_PC_RELATIVE_LOAD_ADDR_P): New macro. (IS_LITERAL_OR_SYMBOLIC_S16_P): Likewise. (IS_LITERAL_OR_SYMBOLIC_U16_P): Likewise. (IS_NON_EXPLICIT_CONSTANT_P): Likewise. (EXTRA_CONSTRAINT_Csy, EXTRA_CONSTRAINT_Z, EXTRA_CONSTRAINT_W, EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C, EXTRA_MEMORY_CONSTRAINT, EXTRA_CONSTRAINT_Sr0, EXTRA_CONSTRAINT_Sua, EXTRA_CONSTRAINT_S, EXTRA_CONSTRAINT_STR): Likewise. (GO_IF_LEGITIMATE_INDEX): Fix indentation. From-SVN: r125561
2007-06-08 08:59:55 +02:00
|| !satisfies_constraint_I08 (operands[2])))))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
if (scratch && GET_MODE (scratch) == mode)
{
emit_move_insn (scratch, operands[2]);
operands[2] = scratch;
}
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
else if (can_create_pseudo_p ())
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
operands[2] = force_reg (mode, operands[2]);
}
return comparison;
}
void
expand_cbranchsi4 (rtx *operands, enum rtx_code comparison, int probability)
{
rtx (*branch_expander) (rtx) = gen_branch_true;
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
comparison = prepare_cbranch_operands (operands, SImode, comparison);
switch (comparison)
{
case NE: case LT: case LE: case LTU: case LEU:
comparison = reverse_condition (comparison);
branch_expander = gen_branch_false;
default: ;
}
emit_insn (gen_rtx_SET (VOIDmode, get_t_reg_rtx (),
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
gen_rtx_fmt_ee (comparison, SImode,
operands[1], operands[2])));
rtx jump = emit_jump_insn (branch_expander (operands[3]));
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
if (probability >= 0)
add_reg_note (jump, REG_BR_PROB, GEN_INT (probability));
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
}
/* ??? How should we distribute probabilities when more than one branch
is generated. So far we only have some ad-hoc observations:
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
- If the operands are random, they are likely to differ in both parts.
- If comparing items in a hash chain, the operands are random or equal;
operation should be EQ or NE.
- If items are searched in an ordered tree from the root, we can expect
the highpart to be unequal about half of the time; operation should be
an inequality comparison, operands non-constant, and overall probability
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
about 50%. Likewise for quicksort.
- Range checks will be often made against constants. Even if we assume for
simplicity an even distribution of the non-constant operand over a
sub-range here, the same probability could be generated with differently
wide sub-ranges - as long as the ratio of the part of the subrange that
is before the threshold to the part that comes after the threshold stays
the same. Thus, we can't really tell anything here;
assuming random distribution is at least simple.
*/
bool
expand_cbranchdi4 (rtx *operands, enum rtx_code comparison)
{
enum rtx_code msw_taken, msw_skip, lsw_taken;
rtx skip_label = NULL_RTX;
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
rtx op1h, op1l, op2h, op2l;
int num_branches;
int prob, rev_prob;
int msw_taken_prob = -1, msw_skip_prob = -1, lsw_taken_prob = -1;
rtx scratch = operands[4];
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
comparison = prepare_cbranch_operands (operands, DImode, comparison);
op1h = gen_highpart_mode (SImode, DImode, operands[1]);
op2h = gen_highpart_mode (SImode, DImode, operands[2]);
op1l = gen_lowpart (SImode, operands[1]);
op2l = gen_lowpart (SImode, operands[2]);
msw_taken = msw_skip = lsw_taken = LAST_AND_UNUSED_RTX_CODE;
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
prob = split_branch_probability;
rev_prob = REG_BR_PROB_BASE - prob;
switch (comparison)
{
/* ??? Should we use the cmpeqdi_t pattern for equality comparisons?
That costs 1 cycle more when the first branch can be predicted taken,
but saves us mispredicts because only one branch needs prediction.
It also enables generating the cmpeqdi_t-1 pattern. */
case EQ:
if (TARGET_CMPEQDI_T)
{
emit_insn (gen_cmpeqdi_t (operands[1], operands[2]));
emit_jump_insn (gen_branch_true (operands[3]));
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
return true;
}
msw_skip = NE;
lsw_taken = EQ;
if (prob >= 0)
{
// If we had more precision, we'd use rev_prob - (rev_prob >> 32) .
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
msw_skip_prob = rev_prob;
if (REG_BR_PROB_BASE <= 65535)
lsw_taken_prob = prob ? REG_BR_PROB_BASE : 0;
else
{
gcc_assert (HOST_BITS_PER_WIDEST_INT >= 64);
lsw_taken_prob
= (prob
? (REG_BR_PROB_BASE
- ((HOST_WIDEST_INT) REG_BR_PROB_BASE * rev_prob
/ ((HOST_WIDEST_INT) prob << 32)))
: 0);
}
}
break;
case NE:
if (TARGET_CMPEQDI_T)
{
emit_insn (gen_cmpeqdi_t (operands[1], operands[2]));
emit_jump_insn (gen_branch_false (operands[3]));
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
return true;
}
msw_taken = NE;
msw_taken_prob = prob;
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
lsw_taken = NE;
lsw_taken_prob = 0;
break;
case GTU: case GT:
msw_taken = comparison;
if (CONST_INT_P (op2l) && INTVAL (op2l) == -1)
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
break;
if (comparison != GTU || op2h != CONST0_RTX (SImode))
msw_skip = swap_condition (msw_taken);
lsw_taken = GTU;
break;
case GEU: case GE:
if (op2l == CONST0_RTX (SImode))
msw_taken = comparison;
else
{
msw_taken = comparison == GE ? GT : GTU;
msw_skip = swap_condition (msw_taken);
lsw_taken = GEU;
}
break;
case LTU: case LT:
msw_taken = comparison;
if (op2l == CONST0_RTX (SImode))
break;
msw_skip = swap_condition (msw_taken);
lsw_taken = LTU;
break;
case LEU: case LE:
if (CONST_INT_P (op2l) && INTVAL (op2l) == -1)
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
msw_taken = comparison;
else
{
lsw_taken = LEU;
if (comparison == LE)
msw_taken = LT;
else if (op2h != CONST0_RTX (SImode))
msw_taken = LTU;
else
{
msw_skip = swap_condition (LTU);
break;
}
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
msw_skip = swap_condition (msw_taken);
}
break;
default: return false;
}
num_branches = ((msw_taken != LAST_AND_UNUSED_RTX_CODE)
+ (msw_skip != LAST_AND_UNUSED_RTX_CODE)
+ (lsw_taken != LAST_AND_UNUSED_RTX_CODE));
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
if (comparison != EQ && comparison != NE && num_branches > 1)
{
if (!CONSTANT_P (operands[2])
&& prob >= (int) (REG_BR_PROB_BASE * 3 / 8U)
&& prob <= (int) (REG_BR_PROB_BASE * 5 / 8U))
{
msw_taken_prob = prob / 2U;
msw_skip_prob
= REG_BR_PROB_BASE * rev_prob / (REG_BR_PROB_BASE + rev_prob);
lsw_taken_prob = prob;
}
else
{
msw_taken_prob = prob;
msw_skip_prob = REG_BR_PROB_BASE;
/* ??? If we have a constant op2h, should we use that when
calculating lsw_taken_prob? */
lsw_taken_prob = prob;
}
}
operands[1] = op1h;
operands[2] = op2h;
operands[4] = NULL_RTX;
if (reload_completed
&& ! arith_reg_or_0_operand (op2h, SImode)
&& (true_regnum (op1h) || (comparison != EQ && comparison != NE))
&& (msw_taken != LAST_AND_UNUSED_RTX_CODE
|| msw_skip != LAST_AND_UNUSED_RTX_CODE))
{
emit_move_insn (scratch, operands[2]);
operands[2] = scratch;
}
if (msw_taken != LAST_AND_UNUSED_RTX_CODE)
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
expand_cbranchsi4 (operands, msw_taken, msw_taken_prob);
if (msw_skip != LAST_AND_UNUSED_RTX_CODE)
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
{
rtx taken_label = operands[3];
/* Operands were possibly modified, but msw_skip doesn't expect this.
Always use the original ones. */
if (msw_taken != LAST_AND_UNUSED_RTX_CODE)
{
operands[1] = op1h;
operands[2] = op2h;
if (reload_completed
&& ! arith_reg_or_0_operand (op2h, SImode)
&& (true_regnum (op1h) || (comparison != EQ && comparison != NE)))
{
emit_move_insn (scratch, operands[2]);
operands[2] = scratch;
}
}
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
operands[3] = skip_label = gen_label_rtx ();
expand_cbranchsi4 (operands, msw_skip, msw_skip_prob);
operands[3] = taken_label;
}
operands[1] = op1l;
operands[2] = op2l;
if (lsw_taken != LAST_AND_UNUSED_RTX_CODE)
{
if (reload_completed
&& ! arith_reg_or_0_operand (op2l, SImode)
&& (true_regnum (op1l) || (lsw_taken != EQ && lsw_taken != NE)))
{
emit_move_insn (scratch, operands[2]);
operands[2] = scratch;
}
expand_cbranchsi4 (operands, lsw_taken, lsw_taken_prob);
}
if (msw_skip != LAST_AND_UNUSED_RTX_CODE)
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
emit_label (skip_label);
return true;
}
/* Given an operand, return 1 if the evaluated operand plugged into an
if_then_else will result in a branch_true, 0 if branch_false, or
-1 if neither nor applies. The truth table goes like this:
op | cmpval | code | result
---------+--------+---------+--------------------
T (0) | 0 | EQ (1) | 0 = 0 ^ (0 == 1)
T (0) | 1 | EQ (1) | 1 = 0 ^ (1 == 1)
T (0) | 0 | NE (0) | 1 = 0 ^ (0 == 0)
T (0) | 1 | NE (0) | 0 = 0 ^ (1 == 0)
!T (1) | 0 | EQ (1) | 1 = 1 ^ (0 == 1)
!T (1) | 1 | EQ (1) | 0 = 1 ^ (1 == 1)
!T (1) | 0 | NE (0) | 0 = 1 ^ (0 == 0)
!T (1) | 1 | NE (0) | 1 = 1 ^ (1 == 0) */
int
sh_eval_treg_value (rtx op)
{
enum rtx_code code = GET_CODE (op);
if ((code != EQ && code != NE) || !CONST_INT_P (XEXP (op, 1)))
return -1;
int cmpop = code == EQ ? 1 : 0;
int cmpval = INTVAL (XEXP (op, 1));
if (cmpval != 0 && cmpval != 1)
return -1;
int t;
if (t_reg_operand (XEXP (op, 0), GET_MODE (XEXP (op, 0))))
t = 0;
else if (negt_reg_operand (XEXP (op, 0), GET_MODE (XEXP (op, 0))))
t = 1;
else
return -1;
return t ^ (cmpval == cmpop);
}
/* Emit INSN, possibly in a PARALLEL with an USE of fpscr for SH4. */
static void
sh_emit_set_t_insn (rtx insn, enum machine_mode mode)
{
if ((TARGET_SH4 || TARGET_SH2A) && GET_MODE_CLASS (mode) == MODE_FLOAT)
{
insn = gen_rtx_PARALLEL (VOIDmode,
gen_rtvec (2, insn,
gen_rtx_USE (VOIDmode, get_fpscr_rtx ())));
(mode == SFmode ? emit_sf_insn : emit_df_insn) (insn);
}
else
emit_insn (insn);
}
1995-04-21 03:19:27 +02:00
/* Prepare the operands for an scc instruction; make sure that the
compare has been done and the result is in T_REG. */
void
sh_emit_scc_to_t (enum rtx_code code, rtx op0, rtx op1)
1995-04-21 03:19:27 +02:00
{
rtx t_reg = get_t_reg_rtx ();
1995-04-21 03:19:27 +02:00
enum rtx_code oldcode = code;
enum machine_mode mode;
1995-04-21 03:19:27 +02:00
/* First need a compare insn. */
switch (code)
1993-04-30 16:29:19 +02:00
{
1995-04-21 03:19:27 +02:00
case NE:
/* It isn't possible to handle this case. */
gcc_unreachable ();
1995-04-21 03:19:27 +02:00
case LT:
code = GT;
break;
case LE:
code = GE;
break;
case LTU:
code = GTU;
break;
case LEU:
code = GEU;
break;
default:
break;
1993-04-30 16:29:19 +02:00
}
1995-04-21 03:19:27 +02:00
if (code != oldcode)
1993-06-29 02:10:35 +02:00
{
rtx tmp = op0;
op0 = op1;
op1 = tmp;
}
1993-06-29 02:10:35 +02:00
mode = GET_MODE (op0);
if (mode == VOIDmode)
mode = GET_MODE (op1);
op0 = force_reg (mode, op0);
if ((code != EQ && code != NE
&& (op1 != const0_rtx
|| code == GTU || code == GEU || code == LTU || code == LEU))
|| (mode == DImode && op1 != const0_rtx)
|| (TARGET_SH2E && GET_MODE_CLASS (mode) == MODE_FLOAT))
op1 = force_reg (mode, op1);
sh_emit_set_t_insn (gen_rtx_SET (VOIDmode, t_reg,
gen_rtx_fmt_ee (code, SImode, op0, op1)),
mode);
}
rtx
sh_emit_cheap_store_flag (enum machine_mode mode, enum rtx_code code,
rtx op0, rtx op1)
{
rtx target = gen_reg_rtx (SImode);
rtx tmp;
gcc_assert (TARGET_SHMEDIA);
switch (code)
{
case EQ:
case GT:
case LT:
case UNORDERED:
case GTU:
case LTU:
tmp = gen_rtx_fmt_ee (code, SImode, op0, op1);
emit_insn (gen_cstore4_media (target, tmp, op0, op1));
code = NE;
break;
case NE:
case GE:
case LE:
case ORDERED:
case GEU:
case LEU:
tmp = gen_rtx_fmt_ee (reverse_condition (code), mode, op0, op1);
emit_insn (gen_cstore4_media (target, tmp, op0, op1));
code = EQ;
break;
case UNEQ:
case UNGE:
case UNGT:
case UNLE:
case UNLT:
case LTGT:
return NULL_RTX;
default:
gcc_unreachable ();
}
if (mode == DImode)
{
rtx t2 = gen_reg_rtx (DImode);
emit_insn (gen_extendsidi2 (t2, target));
target = t2;
}
return gen_rtx_fmt_ee (code, VOIDmode, target, const0_rtx);
1993-04-30 16:29:19 +02:00
}
1995-04-21 03:19:27 +02:00
/* Called from the md file, set up the operands of a compare instruction. */
void
sh_emit_compare_and_branch (rtx *operands, enum machine_mode mode)
1993-04-30 16:29:19 +02:00
{
enum rtx_code code = GET_CODE (operands[0]);
enum rtx_code branch_code;
rtx op0 = operands[1];
rtx op1 = operands[2];
rtx insn, tem;
bool need_ccmpeq = false;
if (TARGET_SH2E && GET_MODE_CLASS (mode) == MODE_FLOAT)
1993-04-30 16:29:19 +02:00
{
op0 = force_reg (mode, op0);
op1 = force_reg (mode, op1);
1993-04-30 16:29:19 +02:00
}
else
{
if (code != EQ || mode == DImode)
{
/* Force args into regs, since we can't use constants here. */
op0 = force_reg (mode, op0);
if (op1 != const0_rtx || code == GTU || code == GEU)
op1 = force_reg (mode, op1);
}
}
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
if (code == LT
|| (code == LE && TARGET_IEEE && TARGET_SH2E)
|| (code == GE && !(TARGET_IEEE && TARGET_SH2E)))
{
tem = op0, op0 = op1, op1 = tem;
code = swap_condition (code);
}
/* GE becomes fcmp/gt+fcmp/eq, for SH2E and TARGET_IEEE only. */
if (code == GE)
{
gcc_assert (TARGET_IEEE && TARGET_SH2E);
need_ccmpeq = true;
code = GT;
}
/* Now we can have EQ, NE, GT, LE. NE and LE are then transformed
to EQ/GT respectively. */
gcc_assert (code == EQ || code == GT || code == NE || code == LE);
}
switch (code)
{
case EQ:
case GT:
case GE:
case GTU:
case GEU:
branch_code = code;
break;
case NE:
case LT:
case LE:
case LTU:
case LEU:
branch_code = reverse_condition (code);
break;
default:
gcc_unreachable ();
}
insn = gen_rtx_SET (VOIDmode,
get_t_reg_rtx (),
gen_rtx_fmt_ee (branch_code, SImode, op0, op1));
sh_emit_set_t_insn (insn, mode);
if (need_ccmpeq)
sh_emit_set_t_insn (gen_ieee_ccmpeqsf_t (op0, op1), mode);
if (branch_code == code)
emit_jump_insn (gen_branch_true (operands[3]));
else
emit_jump_insn (gen_branch_false (operands[3]));
}
void
sh_emit_compare_and_set (rtx *operands, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (operands[1]);
rtx op0 = operands[2];
rtx op1 = operands[3];
rtx lab = NULL_RTX;
bool invert = false;
rtx tem;
op0 = force_reg (mode, op0);
if ((code != EQ && code != NE
&& (op1 != const0_rtx
|| code == GTU || code == GEU || code == LTU || code == LEU))
|| (mode == DImode && op1 != const0_rtx)
|| (TARGET_SH2E && GET_MODE_CLASS (mode) == MODE_FLOAT))
op1 = force_reg (mode, op1);
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
if (code == LT || code == LE)
{
code = swap_condition (code);
tem = op0, op0 = op1, op1 = tem;
}
if (code == GE)
{
if (TARGET_IEEE)
{
lab = gen_label_rtx ();
sh_emit_scc_to_t (EQ, op0, op1);
emit_jump_insn (gen_branch_true (lab));
code = GT;
}
else
{
code = LT;
invert = true;
}
}
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
if (code == NE)
{
code = EQ;
invert = true;
}
sh_emit_scc_to_t (code, op0, op1);
if (lab)
emit_label (lab);
if (invert)
emit_insn (gen_movnegt (operands[0], get_t_reg_rtx ()));
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
else
emit_move_insn (operands[0], get_t_reg_rtx ());
1993-04-30 16:29:19 +02:00
}
/* Functions to output assembly code. */
1993-04-30 16:29:19 +02:00
1993-06-29 02:10:35 +02:00
/* Return a sequence of instructions to perform DI or DF move.
1993-04-30 16:29:19 +02:00
1993-06-29 02:10:35 +02:00
Since the SH cannot move a DI or DF in one instruction, we have
to take care when we see overlapping source and dest registers. */
const char *
output_movedouble (rtx insn ATTRIBUTE_UNUSED, rtx operands[],
enum machine_mode mode)
1993-04-30 16:29:19 +02:00
{
1993-06-29 02:10:35 +02:00
rtx dst = operands[0];
rtx src = operands[1];
if (MEM_P (dst)
&& GET_CODE (XEXP (dst, 0)) == PRE_DEC)
1995-04-21 03:19:27 +02:00
return "mov.l %T1,%0\n\tmov.l %1,%0";
1993-06-29 02:10:35 +02:00
if (register_operand (dst, mode)
&& register_operand (src, mode))
1993-04-30 16:29:19 +02:00
{
1993-06-29 02:10:35 +02:00
if (REGNO (src) == MACH_REG)
return "sts mach,%S0\n\tsts macl,%R0";
1993-04-30 16:29:19 +02:00
1995-04-21 03:19:27 +02:00
/* When mov.d r1,r2 do r2->r3 then r1->r2;
when mov.d r1,r0 do r1->r0 then r2->r1. */
1993-06-29 02:10:35 +02:00
if (REGNO (src) + 1 == REGNO (dst))
return "mov %T1,%T0\n\tmov %1,%0";
1993-06-29 02:10:35 +02:00
else
return "mov %1,%0\n\tmov %T1,%T0";
1993-06-29 02:10:35 +02:00
}
else if (CONST_INT_P (src))
1993-04-30 16:29:19 +02:00
{
1995-04-21 03:19:27 +02:00
if (INTVAL (src) < 0)
output_asm_insn ("mov #-1,%S0", operands);
1993-04-30 16:29:19 +02:00
else
1995-04-21 03:19:27 +02:00
output_asm_insn ("mov #0,%S0", operands);
1993-04-30 16:29:19 +02:00
1995-04-21 03:19:27 +02:00
return "mov %1,%R0";
}
else if (MEM_P (src))
1993-04-30 16:29:19 +02:00
{
1995-04-21 03:19:27 +02:00
int ptrreg = -1;
1993-06-29 02:10:35 +02:00
int dreg = REGNO (dst);
rtx inside = XEXP (src, 0);
1993-04-30 16:29:19 +02:00
switch (GET_CODE (inside))
1993-04-30 16:29:19 +02:00
{
case REG:
ptrreg = REGNO (inside);
break;
case SUBREG:
ptrreg = subreg_regno (inside);
break;
case PLUS:
1995-04-21 03:19:27 +02:00
ptrreg = REGNO (XEXP (inside, 0));
/* ??? A r0+REG address shouldn't be possible here, because it isn't
an offsettable address. Unfortunately, offsettable addresses use
QImode to check the offset, and a QImode offsettable address
requires r0 for the other operand, which is not currently
supported, so we can't use the 'o' constraint.
Thus we must check for and handle r0+REG addresses here.
We punt for now, since this is likely very rare. */
gcc_assert (!REG_P (XEXP (inside, 1)));
break;
case LABEL_REF:
return "mov.l %1,%0\n\tmov.l %1+4,%T0";
case POST_INC:
return "mov.l %1,%0\n\tmov.l %1,%T0";
default:
gcc_unreachable ();
1993-04-30 16:29:19 +02:00
}
1995-04-21 03:19:27 +02:00
/* Work out the safe way to copy. Copy into the second half first. */
if (dreg == ptrreg)
return "mov.l %T1,%T0\n\tmov.l %1,%0";
1993-04-30 16:29:19 +02:00
}
return "mov.l %1,%0\n\tmov.l %T1,%T0";
1993-04-30 16:29:19 +02:00
}
1995-04-21 03:19:27 +02:00
/* Print an instruction which would have gone into a delay slot after
another instruction, but couldn't because the other instruction expanded
into a sequence where putting the slot insn at the end wouldn't work. */
1995-04-21 03:19:27 +02:00
static void
print_slot (rtx insn)
1995-04-21 03:19:27 +02:00
{
final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, optimize, 1, NULL);
1993-06-29 02:10:35 +02:00
1995-04-21 03:19:27 +02:00
INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1;
}
const char *
output_far_jump (rtx insn, rtx op)
{
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
struct { rtx lab, reg, op; } this_jmp;
rtx braf_base_lab = NULL_RTX;
const char *jump;
int far;
int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn));
rtx prev;
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_jmp.lab = gen_label_rtx ();
1993-06-29 02:10:35 +02:00
if (TARGET_SH2
&& offset >= -32764
&& offset - get_attr_length (insn) <= 32766)
{
far = 0;
jump = "mov.w %O0,%1; braf %1";
}
else
{
far = 1;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
if (flag_pic)
{
if (TARGET_SH2)
jump = "mov.l %O0,%1; braf %1";
else
jump = "mov.l r0,@-r15; mova %O0,r0; mov.l @r0,%1; add r0,%1; mov.l @r15+,r0; jmp @%1";
}
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
else
jump = "mov.l %O0,%1; jmp @%1";
}
/* If we have a scratch register available, use it. */
if (NONJUMP_INSN_P ((prev = prev_nonnote_insn (insn)))
&& INSN_CODE (prev) == CODE_FOR_indirect_jump_scratch)
{
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_jmp.reg = SET_DEST (XVECEXP (PATTERN (prev), 0, 0));
if (REGNO (this_jmp.reg) == R0_REG && flag_pic && ! TARGET_SH2)
jump = "mov.l r1,@-r15; mova %O0,r0; mov.l @r0,r1; add r1,r0; mov.l @r15+,r1; jmp @%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
output_asm_insn (jump, &this_jmp.lab);
if (dbr_sequence_length ())
print_slot (final_sequence);
else
output_asm_insn ("nop", 0);
}
else
{
/* Output the delay slot insn first if any. */
if (dbr_sequence_length ())
print_slot (final_sequence);
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_jmp.reg = gen_rtx_REG (SImode, 13);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* We must keep the stack aligned to 8-byte boundaries on SH5.
Fortunately, MACL is fixed and call-clobbered, and we never
need its value across jumps, so save r13 in it instead of in
the stack. */
if (TARGET_SH5)
output_asm_insn ("lds r13, macl", 0);
else
output_asm_insn ("mov.l r13,@-r15", 0);
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
output_asm_insn (jump, &this_jmp.lab);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH5)
output_asm_insn ("sts macl, r13", 0);
else
output_asm_insn ("mov.l @r15+,r13", 0);
}
if (far && flag_pic && TARGET_SH2)
{
braf_base_lab = gen_label_rtx ();
(*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (braf_base_lab));
}
if (far)
output_asm_insn (".align 2", 0);
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
(*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (this_jmp.lab));
this_jmp.op = op;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
if (far && flag_pic)
{
if (TARGET_SH2)
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_jmp.lab = braf_base_lab;
output_asm_insn (".long %O2-%O0", &this_jmp.lab);
}
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
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
output_asm_insn (far ? ".long %O2" : ".word %O2-%O0", &this_jmp.lab);
return "";
}
1993-04-30 16:29:19 +02:00
1995-04-21 03:19:27 +02:00
/* Local label counter, used for constants in the pool and inside
pattern branches. */
static int lf = 100;
/* Output code for ordinary branches. */
const char *
output_branch (int logic, rtx insn, rtx *operands)
1993-04-30 16:29:19 +02:00
{
switch (get_attr_length (insn))
1993-04-30 16:29:19 +02:00
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
case 6:
/* This can happen if filling the delay slot has caused a forward
branch to exceed its range (we could reverse it, but only
when we know we won't overextend other branches; this should
best be handled by relaxation).
It can also happen when other condbranches hoist delay slot insn
from their destination, thus leading to code size increase.
But the branch will still be in the range -4092..+4098 bytes. */
1993-04-30 16:29:19 +02:00
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (! TARGET_RELAX)
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
int label = lf++;
/* The call to print_slot will clobber the operands. */
rtx op0 = operands[0];
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* If the instruction in the delay slot is annulled (true), then
there is no delay slot where we can put it now. The only safe
place for it is after the label. final will do that by default. */
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (final_sequence
&& ! INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0))
&& get_attr_length (XVECEXP (final_sequence, 0, 1)))
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
{
asm_fprintf (asm_out_file, "\tb%s%ss\t%LLF%d\n", logic ? "f" : "t",
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
ASSEMBLER_DIALECT ? "/" : ".", label);
print_slot (final_sequence);
}
else
asm_fprintf (asm_out_file, "\tb%s\t%LLF%d\n", logic ? "f" : "t", label);
output_asm_insn ("bra\t%l0", &op0);
fprintf (asm_out_file, "\tnop\n");
(*targetm.asm_out.internal_label) (asm_out_file, "LF", label);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
return "";
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* When relaxing, handle this like a short branch. The linker
will fix it up if it still doesn't fit after relaxation. */
case 2:
return logic ? "bt%.\t%l0" : "bf%.\t%l0";
/* These are for SH2e, in which we have to account for the
extra nop because of the hardware bug in annulled branches. */
case 8:
if (! TARGET_RELAX)
{
int label = lf++;
gcc_assert (!final_sequence
|| !(INSN_ANNULLED_BRANCH_P
(XVECEXP (final_sequence, 0, 0))));
asm_fprintf (asm_out_file, "b%s%ss\t%LLF%d\n",
logic ? "f" : "t",
ASSEMBLER_DIALECT ? "/" : ".", label);
fprintf (asm_out_file, "\tnop\n");
output_asm_insn ("bra\t%l0", operands);
fprintf (asm_out_file, "\tnop\n");
(*targetm.asm_out.internal_label) (asm_out_file, "LF", label);
return "";
}
/* When relaxing, fall through. */
case 4:
{
char buffer[10];
sprintf (buffer, "b%s%ss\t%%l0",
logic ? "t" : "f",
ASSEMBLER_DIALECT ? "/" : ".");
output_asm_insn (buffer, &operands[0]);
return "nop";
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
default:
/* There should be no longer branches now - that would
indicate that something has destroyed the branches set
up in machine_dependent_reorg. */
gcc_unreachable ();
}
}
1993-04-30 16:29:19 +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
/* Output a code sequence for INSN using TEMPL with OPERANDS; but before,
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
fill in operands 9 as a label to the successor insn.
We try to use jump threading where possible.
IF CODE matches the comparison in the IF_THEN_ELSE of a following jump,
we assume the jump is taken. I.e. EQ means follow jmp and bf, NE means
follow jmp and bt, if the address is in range. */
const char *
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
output_branchy_insn (enum rtx_code code, const char *templ,
rtx insn, rtx *operands)
{
rtx next_insn = NEXT_INSN (insn);
if (next_insn && JUMP_P (next_insn) && condjump_p (next_insn))
{
rtx src = SET_SRC (PATTERN (next_insn));
if (GET_CODE (src) == IF_THEN_ELSE && GET_CODE (XEXP (src, 0)) != code)
{
/* Following branch not taken */
operands[9] = gen_label_rtx ();
emit_label_after (operands[9], next_insn);
INSN_ADDRESSES_NEW (operands[9],
INSN_ADDRESSES (INSN_UID (next_insn))
+ get_attr_length (next_insn));
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 templ;
}
else
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
int offset = (branch_dest (next_insn)
- INSN_ADDRESSES (INSN_UID (next_insn)) + 4);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (offset >= -252 && offset <= 258)
{
if (GET_CODE (src) == IF_THEN_ELSE)
/* branch_true */
src = XEXP (src, 1);
operands[9] = src;
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 templ;
}
}
1993-04-30 16:29:19 +02:00
}
operands[9] = gen_label_rtx ();
emit_label_after (operands[9], insn);
INSN_ADDRESSES_NEW (operands[9],
INSN_ADDRESSES (INSN_UID (insn))
+ get_attr_length (insn));
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 templ;
}
const char *
output_ieee_ccmpeq (rtx insn, rtx *operands)
{
return output_branchy_insn (NE, "bt\t%l9\n\tfcmp/eq\t%1,%0",
insn, operands);
1993-04-30 16:29:19 +02:00
}
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
/* Output the start of the assembler file. */
1995-04-21 03:19:27 +02:00
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
sh_file_start (void)
1993-04-30 16:29:19 +02:00
{
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 ();
if (TARGET_ELF)
/* We need to show the text section with the proper
attributes as in TEXT_SECTION_ASM_OP, before dwarf2out
emits it without attributes in TEXT_SECTION_ASM_OP, else GAS
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
will complain. We can teach GAS specifically about the
default attributes for our choice of text section, but
then we would have to change GAS again if/when we change
the text section name. */
fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
else
/* Switch to the data section so that the coffsem symbol
isn't in the text section. */
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
switch_to_section (data_section);
1993-06-29 02:10:35 +02:00
1995-04-21 03:19:27 +02:00
if (TARGET_LITTLE_ENDIAN)
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.little\n", asm_out_file);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
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
if (!TARGET_ELF)
{
if (TARGET_SHCOMPACT)
fputs ("\t.mode\tSHcompact\n", asm_out_file);
else if (TARGET_SHMEDIA)
fprintf (asm_out_file, "\t.mode\tSHmedia\n\t.abi\t%i\n",
TARGET_SHMEDIA64 ? 64 : 32);
}
1993-04-30 16:29:19 +02:00
}
/* Check if PAT includes UNSPEC_CALLER unspec pattern. */
static bool
unspec_caller_rtx_p (rtx pat)
{
sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. gcc/ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete. (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P. (PIC_OFFSET_P): Rename to... (PCREL_SYMOFF_P): ...this. (PIC_DIRECT_ADDR_P): Delete. (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of PIC_OFFSET_P. (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16, UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (print_operand): Remove CONST handling. (unspec_caller_rtx_p): Rewrite to use split_const and check the operands of UNSPEC bases. (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC) with (unspec [A B] UNSPEC_SYMOFF). (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec. (UNSPEC_EXTRACT_U16): Likewise. (UNSPEC_SYMOFF): Likewise. (UNSPEC_PCREL_SYMOFF): Likewise. (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions of constants. (movsi_const_16bit): Likewise. (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise. (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC) with (unspec [A B] UNSPEC_PCREL_SYMOFF). (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B) with (unspec [A B] UNSPEC_SYMOFF). (symPLT_label2reg): Replace (minus A (minus B pc)) with (unspec [A B] PCREL_UNSPEC_SYMOFF). * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16. (Csu): Likewise UNSPEC_EXTRACT_U16. (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P. From-SVN: r141046
2008-10-10 20:28:25 +02:00
rtx base, offset;
int i;
split_const (pat, &base, &offset);
if (GET_CODE (base) == UNSPEC)
{
sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. gcc/ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete. (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P. (PIC_OFFSET_P): Rename to... (PCREL_SYMOFF_P): ...this. (PIC_DIRECT_ADDR_P): Delete. (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of PIC_OFFSET_P. (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16, UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (print_operand): Remove CONST handling. (unspec_caller_rtx_p): Rewrite to use split_const and check the operands of UNSPEC bases. (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC) with (unspec [A B] UNSPEC_SYMOFF). (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec. (UNSPEC_EXTRACT_U16): Likewise. (UNSPEC_SYMOFF): Likewise. (UNSPEC_PCREL_SYMOFF): Likewise. (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions of constants. (movsi_const_16bit): Likewise. (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise. (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC) with (unspec [A B] UNSPEC_PCREL_SYMOFF). (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B) with (unspec [A B] UNSPEC_SYMOFF). (symPLT_label2reg): Replace (minus A (minus B pc)) with (unspec [A B] PCREL_UNSPEC_SYMOFF). * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16. (Csu): Likewise UNSPEC_EXTRACT_U16. (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P. From-SVN: r141046
2008-10-10 20:28:25 +02:00
if (XINT (base, 1) == UNSPEC_CALLER)
return true;
sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. gcc/ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete. (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P. (PIC_OFFSET_P): Rename to... (PCREL_SYMOFF_P): ...this. (PIC_DIRECT_ADDR_P): Delete. (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of PIC_OFFSET_P. (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16, UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (print_operand): Remove CONST handling. (unspec_caller_rtx_p): Rewrite to use split_const and check the operands of UNSPEC bases. (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC) with (unspec [A B] UNSPEC_SYMOFF). (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec. (UNSPEC_EXTRACT_U16): Likewise. (UNSPEC_SYMOFF): Likewise. (UNSPEC_PCREL_SYMOFF): Likewise. (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions of constants. (movsi_const_16bit): Likewise. (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise. (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC) with (unspec [A B] UNSPEC_PCREL_SYMOFF). (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B) with (unspec [A B] UNSPEC_SYMOFF). (symPLT_label2reg): Replace (minus A (minus B pc)) with (unspec [A B] PCREL_UNSPEC_SYMOFF). * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16. (Csu): Likewise UNSPEC_EXTRACT_U16. (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P. From-SVN: r141046
2008-10-10 20:28:25 +02:00
for (i = 0; i < XVECLEN (base, 0); i++)
if (unspec_caller_rtx_p (XVECEXP (base, 0, i)))
return true;
}
return false;
}
/* Indicate that INSN cannot be duplicated. This is true for insn
that generates a unique label. */
static bool
sh_cannot_copy_insn_p (rtx insn)
{
rtx pat;
if (!reload_completed || !flag_pic)
return false;
if (!NONJUMP_INSN_P (insn))
return false;
if (asm_noperands (insn) >= 0)
return false;
pat = PATTERN (insn);
if (GET_CODE (pat) != SET)
return false;
pat = SET_SRC (pat);
if (unspec_caller_rtx_p (pat))
return true;
return false;
}
/* Number of instructions used to make an arithmetic right shift by N. */
static const char ashiftrt_insns[] =
{ 0,1,2,3,4,5,8,8,8,8,8,8,8,8,8,8,2,3,4,5,8,8,8,8,8,8,8,8,8,8,8,2};
/* Description of a logical left or right shift, when expanded to a sequence
of 1/2/8/16 shifts.
Notice that one bit right shifts clobber the T bit. One bit left shifts
are done with an 'add Rn,Rm' insn and thus do not clobber the T bit. */
enum
{
ASHL_CLOBBERS_T = 1 << 0,
LSHR_CLOBBERS_T = 1 << 1
};
struct ashl_lshr_sequence
{
char insn_count;
char amount[6];
char clobbers_t;
};
static const struct ashl_lshr_sequence ashl_lshr_seq[32] =
{
{ 0, { 0 }, 0 }, // 0
{ 1, { 1 }, LSHR_CLOBBERS_T },
{ 1, { 2 }, 0 },
{ 2, { 2, 1 }, LSHR_CLOBBERS_T },
{ 2, { 2, 2 }, 0 }, // 4
{ 3, { 2, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 2, 2, 2 }, 0 },
{ 4, { 2, 2, 1, 2 }, LSHR_CLOBBERS_T },
{ 1, { 8 }, 0 }, // 8
{ 2, { 8, 1 }, LSHR_CLOBBERS_T },
{ 2, { 8, 2 }, 0 },
{ 3, { 8, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 8, 2, 2 }, 0 }, // 12
{ 4, { 8, 2, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 8, -2, 8 }, 0 },
{ 3, { 8, -1, 8 }, ASHL_CLOBBERS_T },
{ 1, { 16 }, 0 }, // 16
{ 2, { 16, 1 }, LSHR_CLOBBERS_T },
{ 2, { 16, 2 }, 0 },
{ 3, { 16, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 16, 2, 2 }, 0 }, // 20
{ 4, { 16, 2, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 16, -2, 8 }, 0 },
{ 3, { 16, -1, 8 }, ASHL_CLOBBERS_T },
{ 2, { 16, 8 }, 0 }, // 24
{ 3, { 16, 1, 8 }, LSHR_CLOBBERS_T },
{ 3, { 16, 8, 2 }, 0 },
{ 4, { 16, 8, 1, 2 }, LSHR_CLOBBERS_T },
{ 4, { 16, 8, 2, 2 }, 0 }, // 28
{ 4, { 16, -1, -2, 16 }, ASHL_CLOBBERS_T },
{ 3, { 16, -2, 16 }, 0 },
/* For a right shift by 31 a 2 insn shll-movt sequence can be used.
For a left shift by 31 a 2 insn and-rotl sequences can be used.
However, the shift-and combiner code needs this entry here to be in
terms of real shift insns. */
{ 3, { 16, -1, 16 }, ASHL_CLOBBERS_T }
};
/* Individual shift amounts for shift amounts < 16, up to three highmost
bits might be clobbered. This is typically used when combined with some
kind of sign or zero extension. */
static const struct ashl_lshr_sequence ext_ashl_lshr_seq[32] =
{
{ 0, { 0 }, 0 }, // 0
{ 1, { 1 }, LSHR_CLOBBERS_T },
{ 1, { 2 }, 0 },
{ 2, { 2, 1 }, LSHR_CLOBBERS_T },
{ 2, { 2, 2 }, 0 }, // 4
{ 3, { 2, 1, 2 }, LSHR_CLOBBERS_T },
{ 2, { 8, -2 }, 0 },
{ 2, { 8, -1 }, ASHL_CLOBBERS_T },
{ 1, { 8 }, 0 }, // 8
{ 2, { 8, 1 }, LSHR_CLOBBERS_T },
{ 2, { 8, 2 }, 0 },
{ 3, { 8, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 8, 2, 2 }, 0 }, // 12
{ 3, { 16, -2, -1 }, ASHL_CLOBBERS_T },
{ 2, { 16, -2 }, 0 },
{ 2, { 16, -1 }, ASHL_CLOBBERS_T },
{ 1, { 16 }, 0 }, // 16
{ 2, { 16, 1 }, LSHR_CLOBBERS_T },
{ 2, { 16, 2 }, 0 },
{ 3, { 16, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 16, 2, 2 }, 0 }, // 20
{ 4, { 16, 2, 1, 2 }, LSHR_CLOBBERS_T },
{ 3, { 16, -2, 8 }, 0 },
{ 3, { 16, -1, 8 }, ASHL_CLOBBERS_T },
{ 2, { 16, 8 }, 0 }, // 24
{ 3, { 16, 1, 8 }, LSHR_CLOBBERS_T },
{ 3, { 16, 8, 2 }, 0 },
{ 4, { 16, 8, 1, 2 }, LSHR_CLOBBERS_T },
{ 4, { 16, 8, 2, 2 }, 0 }, // 28
{ 4, { 16, -1, -2, 16 }, ASHL_CLOBBERS_T },
{ 3, { 16, -2, 16 }, 0 },
{ 3, { 16, -1, 16 }, ASHL_CLOBBERS_T }
};
/* Return true if a shift left consisting of 1/2/8/16 shift instructions
will clobber the T bit. */
bool
sh_ashlsi_clobbers_t_reg_p (rtx shift_amount)
{
gcc_assert (CONST_INT_P (shift_amount));
const int shift_amount_i = INTVAL (shift_amount) & 31;
/* Special case for shift count of 31: use and-rotl sequence. */
if (shift_amount_i == 31)
return true;
return (ashl_lshr_seq[shift_amount_i].clobbers_t
& ASHL_CLOBBERS_T) != 0;
}
bool
sh_lshrsi_clobbers_t_reg_p (rtx shift_amount)
{
gcc_assert (CONST_INT_P (shift_amount));
const int shift_amount_i = INTVAL (shift_amount) & 31;
/* Special case for shift count of 31: use shll-movt sequence. */
if (shift_amount_i == 31)
return true;
return (ashl_lshr_seq[shift_amount_i].clobbers_t
& LSHR_CLOBBERS_T) != 0;
}
/* Return true if it is potentially beneficial to use a dynamic shift
instruction (shad / shar) instead of a combination of 1/2/8/16
shift instructions for the specified shift count.
If dynamic shifts are not available, always return false. */
bool
sh_dynamicalize_shift_p (rtx count)
{
gcc_assert (CONST_INT_P (count));
const int shift_amount_i = INTVAL (count) & 31;
int insn_count;
/* For left and right shifts, there are shorter 2 insn sequences for
shift amounts of 31. */
if (shift_amount_i == 31)
insn_count = 2;
else
insn_count = ashl_lshr_seq[shift_amount_i].insn_count;
return TARGET_DYNSHIFT && (insn_count > 1 + SH_DYNAMIC_SHIFT_COST);
}
/* Assuming we have a value that has been sign-extended by at least one bit,
can we use the ext_shift_amounts with the last shift turned to an arithmetic shift
to shift it by N without data loss, and quicker than by other means? */
#define EXT_SHIFT_SIGNED(n) (((n) | 8) == 15)
/* Return the cost of a shift. */
1993-04-30 16:29:19 +02:00
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
static inline int
shiftcosts (rtx x)
1993-04-30 16:29:19 +02:00
{
int value;
1995-04-21 03:19:27 +02:00
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHMEDIA)
return 1;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD)
{
if (GET_MODE (x) == DImode
&& CONST_INT_P (XEXP (x, 1))
&& INTVAL (XEXP (x, 1)) == 1)
return 2;
/* Everything else is invalid, because there is no pattern for it. */
return -1;
}
/* If shift by a non constant, then this will be expensive. */
if (!CONST_INT_P (XEXP (x, 1)))
return SH_DYNAMIC_SHIFT_COST;
1993-04-30 16:29:19 +02:00
/* Otherwise, return the true cost in instructions. Cope with out of range
shift counts more or less arbitrarily. */
value = INTVAL (XEXP (x, 1)) & 31;
1995-04-21 03:19:27 +02:00
if (GET_CODE (x) == ASHIFTRT)
{
int cost = ashiftrt_insns[value];
/* If dynamic shifts are available and profitable in this case, then we
put the constant in a reg and use shad. */
if (cost > 1 + SH_DYNAMIC_SHIFT_COST)
cost = 1 + SH_DYNAMIC_SHIFT_COST;
return cost;
}
1995-04-21 03:19:27 +02:00
else
return ashl_lshr_seq[value].insn_count;
}
1993-06-29 02:10:35 +02:00
/* Return the cost of an AND/XOR/IOR operation. */
1995-04-21 03:19:27 +02:00
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
static inline int
and_xor_ior_costs (rtx x, int code)
{
int i;
1995-04-21 03:19:27 +02:00
/* A logical operation with two registers is a single cycle
instruction. */
if (!CONST_INT_P (XEXP (x, 1)))
return 1;
1995-04-21 03:19:27 +02:00
i = INTVAL (XEXP (x, 1));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHMEDIA)
{
constraints.md: New file. * config/sh/constraints.md: New file. * config/sh/sh.c: Include tm-constrs.h. (reg_class_from_letter): Remove. (prepare_cbranch_operands): Use satisfies_constraint_* function instead of macro. (andcosts, broken_move, sh_secondary_reload): Likewise. * config/sh/predicates.md (trapping_target_operand): Likewise. (and_operand, arith_operand, arith_reg_or_0_operand, cmp_operand, logical_operand, target_operand, ua_address_operand, ua_offset, xor_operand): Likewise. * config/sh/sh.md: Include constraints.md. (*movsicc_t_false): Use satisfies_constraint_* function instead of macro. (*movsicc_t_true, ashlsi3_std, ashlhi3_k, lshrsi3_m, lshrsi3_k, movsi_const_16bit+2, *movhi_media+1, movdi_const_16bit+1, beq, bne, *ptb): Likewise. * config/sh/sh.h (reg_class_from_letter): Remove prototype. (OVERRIDE_OPTIONS): Don't modify reg_class_from_letter. (REG_CLASS_FROM_CONSTRAINT): Remove. (CONSTRAINT_LEN, CONST_OK_FOR_I20, CONST_OK_FOR_I, CONST_OK_FOR_J, CONST_OK_FOR_K16, CONST_OK_FOR_K, CONST_OK_FOR_P27, CONST_OK_FOR_P, CONST_OK_FOR_M, CONST_OK_FOR_N, CONST_OK_FOR_CONSTRAINT_P, CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. (SECONDARY_INOUT_RELOAD_CLASS): Use satisfies_constraint_* function instead of macro. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (EXTRA_CONSTRAINT_Q, EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc, EXTRA_CONSTRAINT_B, EXTRA_CONSTRAINT_Css, EXTRA_CONSTRAINT_Csu): Remove. (IS_PC_RELATIVE_LOAD_ADDR_P): New macro. (IS_LITERAL_OR_SYMBOLIC_S16_P): Likewise. (IS_LITERAL_OR_SYMBOLIC_U16_P): Likewise. (IS_NON_EXPLICIT_CONSTANT_P): Likewise. (EXTRA_CONSTRAINT_Csy, EXTRA_CONSTRAINT_Z, EXTRA_CONSTRAINT_W, EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C, EXTRA_MEMORY_CONSTRAINT, EXTRA_CONSTRAINT_Sr0, EXTRA_CONSTRAINT_Sua, EXTRA_CONSTRAINT_S, EXTRA_CONSTRAINT_STR): Likewise. (GO_IF_LEGITIMATE_INDEX): Fix indentation. From-SVN: r125561
2007-06-08 08:59:55 +02:00
if (satisfies_constraint_I10 (XEXP (x, 1))
|| satisfies_constraint_J16 (XEXP (x, 1)))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return 1;
else
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
return 1 + rtx_cost (XEXP (x, 1), AND, 1, !optimize_size);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
/* These constants are single cycle extu.[bw] instructions. */
if ((i == 0xff || i == 0xffff) && code == AND)
return 1;
/* Constants that can be used in an instruction as an immediate are
a single cycle, but this requires r0, so make it a little more
expensive. */
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
if (CONST_OK_FOR_K08 (i))
return 2;
/* Constants that can be loaded with a mov immediate need one more cycle.
This case is probably unnecessary. */
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
if (CONST_OK_FOR_I08 (i))
return 2;
/* Any other constant requires an additional 2 cycle pc-relative load.
This case is probably unnecessary. */
return 3;
}
/* Return the cost of an addition or a subtraction. */
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
static inline int
addsubcosts (rtx x)
{
/* Adding a register is a single cycle insn. */
if (REG_P (XEXP (x, 1))
|| GET_CODE (XEXP (x, 1)) == SUBREG)
return 1;
/* Likewise for small constants. */
if (CONST_INT_P (XEXP (x, 1))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
&& CONST_OK_FOR_ADD (INTVAL (XEXP (x, 1))))
return 1;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHMEDIA)
switch (GET_CODE (XEXP (x, 1)))
{
case CONST:
case LABEL_REF:
case SYMBOL_REF:
return TARGET_SHMEDIA64 ? 5 : 3;
case CONST_INT:
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
if (CONST_OK_FOR_I16 (INTVAL (XEXP (x, 1))))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return 2;
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
else if (CONST_OK_FOR_I16 (INTVAL (XEXP (x, 1)) >> 16))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return 3;
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
else if (CONST_OK_FOR_I16 ((INTVAL (XEXP (x, 1)) >> 16) >> 16))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return 4;
/* Fall through. */
default:
return 5;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
/* Any other constant requires a 2 cycle pc-relative load plus an
addition. */
return 3;
}
/* Return the cost of a multiply. */
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
static inline int
multcosts (rtx x ATTRIBUTE_UNUSED)
{
if (sh_multcost >= 0)
return sh_multcost;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHMEDIA)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* ??? We have a mul insn, but it has a latency of three, and doesn't
accept constants. Ideally, we would use a cost of one or two and
add the cost of the operand, but disregard the latter when inside loops
and loop invariant code motion is still to follow.
Using a multiply first and splitting it later if it's a loss
doesn't work because of different sign / zero extension semantics
of multiplies vs. shifts. */
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
return optimize_size ? 2 : 3;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH2)
{
/* We have a mul insn, so we can never take more than the mul and the
read of the mac reg, but count more because of the latency and extra
reg usage. */
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
if (optimize_size)
return 2;
return 3;
}
/* If we're aiming at small code, then just count the number of
insns in a multiply call sequence. */
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
if (optimize_size)
1995-04-21 03:19:27 +02:00
return 5;
/* Otherwise count all the insns in the routine we'd be calling too. */
return 20;
}
1993-06-29 02:10:35 +02:00
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. */
static bool
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
sh_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
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)
{
/* The lower-subreg pass decides whether to split multi-word regs
into individual regs by looking at the cost for a SET of certain
modes with the following patterns:
(set (reg) (reg))
(set (reg) (const_int 0))
On machines that support vector-move operations a multi-word move
is the same cost as individual reg move. On SH there is no
vector-move, so we have to provide the correct cost in the number
of move insns to load/store the reg of the mode in question. */
case SET:
if (register_operand (SET_DEST (x), VOIDmode)
&& (register_operand (SET_SRC (x), VOIDmode)
|| satisfies_constraint_Z (SET_SRC (x))))
{
const enum machine_mode mode = GET_MODE (SET_DEST (x));
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode)
/ mov_insn_size (mode, TARGET_SH2A));
return true;
}
return false;
/* The cost of a mem access is mainly the cost of the address mode. */
case MEM:
*total = sh_address_cost (XEXP (x, 0), GET_MODE (x), MEM_ADDR_SPACE (x),
true);
return true;
/* The cost of a sign or zero extend depends on whether the source is a
reg or a mem. In case of a mem take the address into acount. */
case SIGN_EXTEND:
if (REG_P (XEXP (x, 0)))
{
*total = COSTS_N_INSNS (1);
return true;
}
if (MEM_P (XEXP (x, 0)))
{
*total = sh_address_cost (XEXP (XEXP (x, 0), 0),
GET_MODE (XEXP (x, 0)),
MEM_ADDR_SPACE (XEXP (x, 0)), true);
return true;
}
return false;
case ZERO_EXTEND:
if (REG_P (XEXP (x, 0)))
{
*total = COSTS_N_INSNS (1);
return true;
}
else if (TARGET_SH2A && MEM_P (XEXP (x, 0))
&& (GET_MODE (XEXP (x, 0)) == QImode
|| GET_MODE (XEXP (x, 0)) == HImode))
{
/* Handle SH2A's movu.b and movu.w insn. */
*total = sh_address_cost (XEXP (XEXP (x, 0), 0),
GET_MODE (XEXP (x, 0)),
MEM_ADDR_SPACE (XEXP (x, 0)), true);
return true;
}
return false;
/* mems for SFmode and DFmode can be inside a parallel due to
the way the fpscr is handled. */
case PARALLEL:
for (int i = 0; i < XVECLEN (x, 0); i++)
{
rtx xx = XVECEXP (x, 0, i);
if (GET_CODE (xx) == SET && MEM_P (XEXP (xx, 0)))
{
*total = sh_address_cost (XEXP (XEXP (xx, 0), 0),
GET_MODE (XEXP (xx, 0)),
MEM_ADDR_SPACE (XEXP (xx, 0)), true);
return true;
}
if (GET_CODE (xx) == SET && MEM_P (XEXP (xx, 1)))
{
*total = sh_address_cost (XEXP (XEXP (xx, 1), 0),
GET_MODE (XEXP (xx, 1)),
MEM_ADDR_SPACE (XEXP (xx, 1)), true);
return true;
}
}
if (sh_1el_vec (x, VOIDmode))
*total = outer_code != SET;
else if (sh_rep_vec (x, VOIDmode))
*total = ((GET_MODE_UNIT_SIZE (GET_MODE (x)) + 3) / 4
+ (outer_code != SET));
else
*total = COSTS_N_INSNS (3) + (outer_code != SET);
return true;
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
case CONST_INT:
if (TARGET_SHMEDIA)
{
if (INTVAL (x) == 0)
*total = 0;
else if (outer_code == AND && and_operand ((x), DImode))
*total = 0;
else if ((outer_code == IOR || outer_code == XOR
|| outer_code == PLUS)
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
&& CONST_OK_FOR_I10 (INTVAL (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;
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
else if (CONST_OK_FOR_I16 (INTVAL (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 = COSTS_N_INSNS (outer_code != SET);
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
else if (CONST_OK_FOR_I16 (INTVAL (x) >> 16))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
*total = COSTS_N_INSNS ((outer_code != SET) + 1);
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
else if (CONST_OK_FOR_I16 ((INTVAL (x) >> 16) >> 16))
2006-01-08 08:47:06 +01:00
*total = COSTS_N_INSNS ((outer_code != SET) + 2);
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
else
2006-01-08 08:47:06 +01:00
*total = COSTS_N_INSNS ((outer_code != SET) + 3);
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;
}
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
if (CONST_OK_FOR_I08 (INTVAL (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 ((outer_code == AND || outer_code == IOR || outer_code == XOR)
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
&& CONST_OK_FOR_K08 (INTVAL (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;
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
/* prepare_cmp_insn will force costly constants int registers before
the cbranch[sd]i4 patterns can see them, so preserve potentially
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
interesting ones not covered by I08 above. */
else if (outer_code == COMPARE
&& ((unsigned HOST_WIDE_INT) INTVAL (x)
== (unsigned HOST_WIDE_INT) 0x7fffffff + 1
|| INTVAL (x) == 0x7fffffff
|| INTVAL (x) == 0x80 || INTVAL (x) == -0x81))
*total = 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
else
*total = 8;
return true;
case EQ:
/* An and with a constant compared against zero is
most likely going to be a TST #imm, R0 instruction.
Notice that this does not catch the zero_extract variants from
the md file. */
if (GET_CODE (XEXP (x, 0)) == AND
&& CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) == 0)
{
*total = 1;
return true;
}
else
return false;
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
case CONST:
case LABEL_REF:
case SYMBOL_REF:
if (TARGET_SHMEDIA64)
*total = COSTS_N_INSNS (4);
else if (TARGET_SHMEDIA32)
*total = COSTS_N_INSNS (2);
else
*total = 5;
return true;
case CONST_DOUBLE:
if (TARGET_SHMEDIA)
*total = COSTS_N_INSNS (4);
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
/* prepare_cmp_insn will force costly constants int registers before
the cbranchdi4 pattern can see them, so preserve potentially
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
interesting ones. */
else if (outer_code == COMPARE && GET_MODE (x) == DImode)
*total = 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
else
*total = 10;
return true;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
case CONST_VECTOR:
/* FIXME: This looks broken. Only the last statement has any effect.
Probably this could be folded with the PARALLEL case? */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (x == CONST0_RTX (GET_MODE (x)))
*total = 0;
else if (sh_1el_vec (x, VOIDmode))
*total = outer_code != SET;
if (sh_rep_vec (x, VOIDmode))
*total = ((GET_MODE_UNIT_SIZE (GET_MODE (x)) + 3) / 4
+ (outer_code != SET));
*total = COSTS_N_INSNS (3) + (outer_code != SET);
return true;
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
case PLUS:
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
case MINUS:
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 = COSTS_N_INSNS (addsubcosts (x));
return true;
case AND:
case XOR:
case IOR:
*total = COSTS_N_INSNS (and_xor_ior_costs (x, code));
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 MULT:
*total = COSTS_N_INSNS (multcosts (x));
return true;
case LT:
case GE:
/* div0s sign comparison. */
if (GET_CODE (XEXP (x, 0)) == XOR
&& REG_P ((XEXP (XEXP (x, 0), 0)))
&& REG_P ((XEXP (XEXP (x, 0), 1)))
&& satisfies_constraint_Z (XEXP (x, 1)))
{
*total = COSTS_N_INSNS (1);
return true;
}
else
return false;
case LSHIFTRT:
/* div0s sign comparison. */
if (GET_CODE (XEXP (x, 0)) == XOR
&& REG_P ((XEXP (XEXP (x, 0), 0)))
&& REG_P ((XEXP (XEXP (x, 0), 1)))
&& CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) == 31)
{
*total = COSTS_N_INSNS (1);
return true;
}
/* Fall through to shiftcosts. */
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
case ASHIFT:
case ASHIFTRT:
{
int cost = shiftcosts (x);
if (cost < 0)
return false;
*total = COSTS_N_INSNS (cost);
return true;
}
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
case DIV:
case UDIV:
case MOD:
case UMOD:
*total = COSTS_N_INSNS (20);
return true;
case FLOAT:
case FIX:
*total = 100;
return true;
default:
return false;
}
}
/* Determine the size of the fundamental move insn that will be used
for the specified mode. */
static inline int
mov_insn_size (enum machine_mode mode, bool consider_sh2a)
{
const int mode_sz = GET_MODE_SIZE (mode);
if ((consider_sh2a && TARGET_SH2A_DOUBLE && mode == DFmode)
|| (TARGET_FMOVD && mode == DFmode))
return mode_sz;
else
{
/* The max. available mode for actual move insns is SImode.
Larger accesses will be split into multiple loads/stores. */
const int max_mov_sz = GET_MODE_SIZE (SImode);
return mode_sz >= max_mov_sz ? max_mov_sz : mode_sz;
}
}
/* Determine the maximum possible displacement for a move insn for the
specified mode. */
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
static int
max_mov_insn_displacement (enum machine_mode mode, bool consider_sh2a)
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
{
/* The 4 byte displacement move insns are the same as the 2 byte
versions but take a 12 bit displacement. All we need to do is to
scale the max. displacement value accordingly. */
const int disp_scale = consider_sh2a ? (4095 / 15) : 1;
/* SH2A supports FPU move insns with 12 bit displacements.
Other variants to do not support any kind of displacements for
FPU move insns. */
if (! consider_sh2a && TARGET_FPU_ANY && GET_MODE_CLASS (mode) == MODE_FLOAT)
return 0;
else
{
const int mov_insn_sz = mov_insn_size (mode, consider_sh2a);
const int mode_sz = GET_MODE_SIZE (mode);
int r = 15 * mov_insn_sz * disp_scale;
/* If the mov insn will be split into multiple loads/stores, the
maximum possible displacement is a bit smaller. */
if (mode_sz > mov_insn_sz)
r -= mode_sz - mov_insn_sz;
return r;
}
}
/* Determine the alignment mask for a move insn of the
specified mode. */
static inline int
mov_insn_alignment_mask (enum machine_mode mode, bool consider_sh2a)
{
const int mov_insn_sz = mov_insn_size (mode, consider_sh2a);
return mov_insn_sz > 0 ? (mov_insn_sz - 1) : 0;
}
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
/* Return the displacement value of a displacement address. */
static inline HOST_WIDE_INT
disp_addr_displacement (rtx x)
{
gcc_assert (satisfies_constraint_Sdd (x));
return INTVAL (XEXP (XEXP (x, 0), 1));
}
/* Compute the cost of an address. */
static int
sh_address_cost (rtx x, enum machine_mode mode,
hooks.c (hook_int_rtx_mode_as_bool_0): New function. * hooks.c (hook_int_rtx_mode_as_bool_0): New function. * hooks.h (hook_int_rtx_mode_as_bool_0): Declare it. * output.h (default_address_cost): Add machine_mode and address space arguments. * target.def (address_cost): Likewise. * rtlanal.c (address_cost): Pass mode and address space to target hook. (default_address_cost): Add unnamed machine_mode and address space arguments. * doc/tm.texi: Regenerate. * config/alpha/alpha.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/arm/arm.c (arm_address_cost): Add machine_mode and address space arguments. * config/avr/avr.c (avr_address_cost): Likewise. * config/bfin/bfin.c (bfin_address_cost): Likewise. * config/cr16/cr16.c (cr16_address_cost): Likewise. * config/cris/cris.c (cris_address_cost): Likewise. * config/epiphany/epiphany.c (epiphany_address_cost): Likewise. * config/i386/i386.c (ix86_address_cost): Likewise. * config/ia64/ia64.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/iq2000/iq2000.c (iq2000_address_cost): Add machine_mode and address space arguments. Pass them on in recursive invocation. * config/lm32/lm32.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/m32c/m32c.c (m32c_address_cost): Add machine_mode and address space arguments. * config/m32r/m32r.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/mcore/mcore.c (TARGET_ADDRESS_COST): Likewise. * config/mep/mep.c (mep_address_cost): Add machine_mode and address space arguments. * config/microblaze/microblaze.c (microblaze_address_cost): Likewise. * config/mips/mips.c (mips_address_cost): Likewise. * config/mmix/mmix.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/mn10300/mn10300.c (mn10300_address_cost): Add machine_mode and address space arguments. (mn10300_rtx_costs): Pass GET_MODE (x) and MEM_ADDR_SPACE (x) to mn10300_address_cost. * config/pa/pa.c (hppa_address_cost): Add machine_mode and address space arguments. * config/rs6000/rs6000.c (rs6000_debug_address_cost): Likewise. (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/rx/rx.c (rx_address_cost): Add machine_mode and address space arguments. * config/s390/s390.c (s390_address_cost): Likewise. * config/score/score-protos.h (score_address_cost): Likewise. * config/score/score.c (score_address_cost): Likewise. * config/sh/sh.c (sh_address_cost): Likewise. * config/sparc/sparc.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/spu/spu.c (TARGET_ADDRESS_COST): Likewise. * config/stormy16/stormy16.c (xstormy16_address_cost): Add machine_mode and address space arguments. * config/v850/v850.c (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. * config/vax/vax.c (vax_address_cost): Add machine_mode and address space arguments. * config/xtensa/xtensa (TARGET_ADDRESS_COST): Use hook_int_rtx_mode_as_bool_0 instead of hook_int_rtx_bool_0. From-SVN: r190990
2012-09-05 19:31:17 +02:00
addr_space_t as ATTRIBUTE_UNUSED, bool speed ATTRIBUTE_UNUSED)
{
/* 'GBR + 0'. Account one more because of R0 restriction. */
if (REG_P (x) && REGNO (x) == GBR_REG)
return 2;
/* Simple reg, post-inc, pre-dec addressing. */
if (REG_P (x) || GET_CODE (x) == POST_INC || GET_CODE (x) == PRE_DEC)
return 1;
/* 'reg + disp' addressing. */
if (GET_CODE (x) == PLUS
&& REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1)))
{
/* 'GBR + disp'. Account one more because of R0 restriction. */
if (REGNO (XEXP (x, 0)) == GBR_REG
&& gbr_displacement (XEXP (x, 1), mode))
return 2;
const HOST_WIDE_INT offset = INTVAL (XEXP (x, 1));
if (offset == 0)
return 1;
/* The displacement would fit into a 2 byte move insn.
HImode and QImode loads/stores with displacement put pressure on
R0 which will most likely require another reg copy. Thus account
a higher cost for that. */
if (offset > 0 && offset <= max_mov_insn_displacement (mode, false))
return (mode == HImode || mode == QImode) ? 2 : 1;
/* The displacement would fit into a 4 byte move insn (SH2A). */
if (TARGET_SH2A
&& offset > 0 && offset <= max_mov_insn_displacement (mode, true))
return 2;
/* The displacement is probably out of range and will require extra
calculations. */
return 3;
}
/* 'reg + reg' addressing. Account a slightly higher cost because of
increased pressure on R0. */
if (GET_CODE (x) == PLUS && ! CONSTANT_P (XEXP (x, 1))
&& ! TARGET_SHMEDIA)
return 3;
/* Not sure what it is - probably expensive. */
return 10;
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
}
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
/* Code to expand a shift. */
1993-06-29 02:10:35 +02:00
static void
gen_ashift (int type, int n, rtx reg)
{
rtx n_rtx;
/* Negative values here come from the shift_amounts array. */
if (n < 0)
{
if (type == ASHIFT)
type = LSHIFTRT;
else
type = ASHIFT;
n = -n;
}
n_rtx = GEN_INT (n);
gcc_assert (satisfies_constraint_P27 (n_rtx));
switch (type)
1993-04-30 16:29:19 +02:00
{
case ASHIFTRT:
emit_insn (gen_ashrsi3_k (reg, reg, n_rtx));
break;
case LSHIFTRT:
if (n == 1)
emit_insn (gen_shlr (reg, reg));
else
emit_insn (gen_lshrsi3_k (reg, reg, n_rtx));
break;
case ASHIFT:
emit_insn (gen_ashlsi3_k (reg, reg, n_rtx));
break;
default:
gcc_unreachable ();
1993-04-30 16:29:19 +02:00
}
}
/* Same for HImode */
static void
gen_ashift_hi (int type, int n, rtx reg)
{
/* Negative values here come from the shift_amounts array. */
if (n < 0)
{
if (type == ASHIFT)
type = LSHIFTRT;
else
type = ASHIFT;
n = -n;
}
switch (type)
{
case ASHIFTRT:
case LSHIFTRT:
/* We don't have HImode right shift operations because using the
ordinary 32 bit shift instructions for that doesn't generate proper
zero/sign extension.
gen_ashift_hi is only called in contexts where we know that the
sign extension works out correctly. */
{
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
int offset = 0;
if (GET_CODE (reg) == SUBREG)
{
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
offset = SUBREG_BYTE (reg);
reg = SUBREG_REG (reg);
}
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
gen_ashift (type, n, gen_rtx_SUBREG (SImode, reg, offset));
break;
}
case ASHIFT:
emit_insn (gen_ashlhi3_k (reg, reg, GEN_INT (n)));
break;
}
}
1995-04-21 03:19:27 +02:00
/* Output RTL to split a constant shift into its component SH constant
shift instructions. */
void
gen_shifty_op (int code, rtx *operands)
1993-04-30 16:29:19 +02:00
{
int value = INTVAL (operands[2]);
1995-04-21 03:19:27 +02:00
int max, i;
/* Truncate the shift count in case it is out of bounds. */
value = value & 31;
1995-04-21 03:19:27 +02:00
if (value == 31)
{
1995-04-21 03:19:27 +02:00
if (code == LSHIFTRT)
{
1995-04-21 03:19:27 +02:00
emit_insn (gen_rotlsi3_1 (operands[0], operands[0]));
emit_insn (gen_movt (operands[0], get_t_reg_rtx ()));
1995-04-21 03:19:27 +02:00
return;
}
1995-04-21 03:19:27 +02:00
else if (code == ASHIFT)
{
1995-04-21 03:19:27 +02:00
/* There is a two instruction sequence for 31 bit left shifts,
but it requires r0. */
if (REG_P (operands[0]) && REGNO (operands[0]) == 0)
{
1995-04-21 03:19:27 +02:00
emit_insn (gen_andsi3 (operands[0], operands[0], const1_rtx));
emit_insn (gen_rotlsi3_31 (operands[0], operands[0]));
return;
}
}
1995-04-21 03:19:27 +02:00
}
else if (value == 0)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* This can happen even when optimizing, if there were subregs before
reload. Don't output a nop here, as this is never optimized away;
use a no-op move instead. */
emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[0]));
return;
}
max = ashl_lshr_seq[value].insn_count;
1995-04-21 03:19:27 +02:00
for (i = 0; i < max; i++)
gen_ashift (code, ashl_lshr_seq[value].amount[i], operands[0]);
1995-04-21 03:19:27 +02:00
}
/* Same as above, but optimized for values where the topmost bits don't
matter. */
void
gen_shifty_hi_op (int code, rtx *operands)
{
int value = INTVAL (operands[2]);
int max, i;
void (*gen_fun) (int, int, rtx);
/* This operation is used by and_shl for SImode values with a few
high bits known to be cleared. */
value &= 31;
if (value == 0)
{
emit_insn (gen_nop ());
return;
}
gen_fun = GET_MODE (operands[0]) == HImode ? gen_ashift_hi : gen_ashift;
if (code == ASHIFT)
{
max = ext_ashl_lshr_seq[value].insn_count;
for (i = 0; i < max; i++)
gen_fun (code, ext_ashl_lshr_seq[value].amount[i], operands[0]);
}
else
/* When shifting right, emit the shifts in reverse order, so that
solitary negative values come first. */
for (i = ext_ashl_lshr_seq[value].insn_count - 1; i >= 0; i--)
gen_fun (code, ext_ashl_lshr_seq[value].amount[i], operands[0]);
}
1995-04-21 03:19:27 +02:00
/* Output RTL for an arithmetic right shift. */
/* ??? Rewrite to use super-optimizer sequences. */
bool
expand_ashiftrt (rtx *operands)
1995-04-21 03:19:27 +02:00
{
rtx wrk;
char func[18];
int value;
if (TARGET_DYNSHIFT)
{
if (!CONST_INT_P (operands[2]))
{
rtx count = copy_to_mode_reg (SImode, operands[2]);
emit_insn (gen_negsi2 (count, count));
emit_insn (gen_ashrsi3_d (operands[0], operands[1], count));
return true;
}
else if (ashiftrt_insns[INTVAL (operands[2]) & 31]
> 1 + SH_DYNAMIC_SHIFT_COST)
{
rtx count
= force_reg (SImode, GEN_INT (- (INTVAL (operands[2]) & 31)));
emit_insn (gen_ashrsi3_d (operands[0], operands[1], count));
return true;
}
}
if (!CONST_INT_P (operands[2]))
return false;
1995-04-21 03:19:27 +02:00
value = INTVAL (operands[2]) & 31;
1995-04-21 03:19:27 +02:00
if (value == 31)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* If we are called from abs expansion, arrange things so that we
we can use a single MT instruction that doesn't clobber the source,
if LICM can hoist out the load of the constant zero. */
if (currently_expanding_to_rtl)
{
emit_insn (gen_cmpgtsi_t (force_reg (SImode, CONST0_RTX (SImode)),
operands[1]));
emit_insn (gen_mov_neg_si_t (operands[0], get_t_reg_rtx ()));
return true;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
}
1995-04-21 03:19:27 +02:00
emit_insn (gen_ashrsi2_31 (operands[0], operands[1]));
return true;
1995-04-21 03:19:27 +02:00
}
else if (value >= 16 && value <= 19)
{
wrk = gen_reg_rtx (SImode);
emit_insn (gen_ashrsi2_16 (wrk, operands[1]));
value -= 16;
while (value--)
gen_ashift (ASHIFTRT, 1, wrk);
emit_move_insn (operands[0], wrk);
return true;
}
1995-04-21 03:19:27 +02:00
/* Expand a short sequence inline, longer call a magic routine. */
else if (value <= 5)
{
wrk = gen_reg_rtx (SImode);
emit_move_insn (wrk, operands[1]);
while (value--)
gen_ashift (ASHIFTRT, 1, wrk);
emit_move_insn (operands[0], wrk);
return true;
1995-04-21 03:19:27 +02:00
}
wrk = gen_reg_rtx (Pmode);
/* Load the value into an arg reg and call a helper. */
emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]);
1995-04-21 03:19:27 +02:00
sprintf (func, "__ashiftrt_r4_%d", value);
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (wrk, func, SFUNC_STATIC);
1995-04-21 03:19:27 +02:00
emit_insn (gen_ashrsi3_n (GEN_INT (value), wrk));
emit_move_insn (operands[0], gen_rtx_REG (SImode, 4));
return true;
1993-04-30 16:29:19 +02:00
}
/* Try to find a good way to implement the combiner pattern
[(set (match_operand:SI 0 "register_operand" "r")
(and:SI (ashift:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "const_int_operand" "n"))
(match_operand:SI 3 "const_int_operand" "n"))) .
LEFT_RTX is operand 2 in the above pattern, and MASK_RTX is operand 3.
return 0 for simple right / left or left/right shift combination.
return 1 for a combination of shifts with zero_extend.
return 2 for a combination of shifts with an AND that needs r0.
return 3 for a combination of shifts with an AND that needs an extra
scratch register, when the three highmost bits of the AND mask are clear.
return 4 for a combination of shifts with an AND that needs an extra
scratch register, when any of the three highmost bits of the AND mask
is set.
If ATTRP is set, store an initial right shift width in ATTRP[0],
and the instruction length in ATTRP[1] . These values are not valid
when returning 0.
When ATTRP is set and returning 1, ATTRP[2] gets set to the index into
shift_amounts for the last shift value that is to be used before the
sign extend. */
int
shl_and_kind (rtx left_rtx, rtx mask_rtx, int *attrp)
{
unsigned HOST_WIDE_INT mask, lsb, mask2, lsb2;
int left = INTVAL (left_rtx), right;
int best = 0;
int cost, best_cost = 10000;
int best_right = 0, best_len = 0;
int i;
int can_ext;
if (left < 0 || left > 31)
return 0;
if (CONST_INT_P (mask_rtx))
mask = (unsigned HOST_WIDE_INT) INTVAL (mask_rtx) >> left;
else
mask = (unsigned HOST_WIDE_INT) GET_MODE_MASK (SImode) >> left;
/* Can this be expressed as a right shift / left shift pair? */
lsb = ((mask ^ (mask - 1)) >> 1) + 1;
right = exact_log2 (lsb);
mask2 = ~(mask + lsb - 1);
lsb2 = ((mask2 ^ (mask2 - 1)) >> 1) + 1;
/* mask has no zeroes but trailing zeroes <==> ! mask2 */
if (! mask2)
best_cost = ashl_lshr_seq[right].insn_count
+ ashl_lshr_seq[right + left].insn_count;
/* mask has no trailing zeroes <==> ! right */
else if (! right && mask2 == ~(lsb2 - 1))
{
int late_right = exact_log2 (lsb2);
best_cost = ashl_lshr_seq[left + late_right].insn_count
+ ashl_lshr_seq[late_right].insn_count;
}
/* Try to use zero extend. */
if (mask2 == ~(lsb2 - 1))
{
int width, first;
for (width = 8; width <= 16; width += 8)
{
/* Can we zero-extend right away? */
if (lsb2 == (unsigned HOST_WIDE_INT) 1 << width)
{
cost = 1 + ext_ashl_lshr_seq[right].insn_count
+ ext_ashl_lshr_seq[left + right].insn_count;
if (cost < best_cost)
{
best = 1;
best_cost = cost;
best_right = right;
best_len = cost;
if (attrp)
attrp[2] = -1;
}
continue;
}
/* ??? Could try to put zero extend into initial right shift,
or even shift a bit left before the right shift. */
/* Determine value of first part of left shift, to get to the
zero extend cut-off point. */
first = width - exact_log2 (lsb2) + right;
if (first >= 0 && right + left - first >= 0)
{
cost = ext_ashl_lshr_seq[right].insn_count
+ ext_ashl_lshr_seq[first].insn_count + 1
+ ext_ashl_lshr_seq[right + left - first].insn_count;
if (cost < best_cost)
{
best = 1;
best_cost = cost;
best_right = right;
best_len = cost;
if (attrp)
attrp[2] = first;
}
}
}
}
/* Try to use r0 AND pattern */
for (i = 0; i <= 2; i++)
{
if (i > right)
break;
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
if (! CONST_OK_FOR_K08 (mask >> i))
continue;
cost = (i != 0) + 2 + ext_ashl_lshr_seq[left + i].insn_count;
if (cost < best_cost)
{
best = 2;
best_cost = cost;
best_right = i;
best_len = cost - 1;
}
}
/* Try to use a scratch register to hold the AND operand. */
can_ext = ((mask << left) & ((unsigned HOST_WIDE_INT) 3 << 30)) == 0;
for (i = 0; i <= 2; i++)
{
if (i > right)
break;
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
cost = (i != 0) + (CONST_OK_FOR_I08 (mask >> i) ? 2 : 3)
+ (can_ext
? ext_ashl_lshr_seq
: ashl_lshr_seq)[left + i].insn_count;
if (cost < best_cost)
{
best = 4 - can_ext;
best_cost = cost;
best_right = i;
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
best_len = cost - 1 - ! CONST_OK_FOR_I08 (mask >> i);
}
}
if (attrp)
{
attrp[0] = best_right;
attrp[1] = best_len;
}
return best;
}
/* This is used in length attributes of the unnamed instructions
corresponding to shl_and_kind return values of 1 and 2. */
int
shl_and_length (rtx insn)
{
rtx set_src, left_rtx, mask_rtx;
int attributes[3];
set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
left_rtx = XEXP (XEXP (set_src, 0), 1);
mask_rtx = XEXP (set_src, 1);
shl_and_kind (left_rtx, mask_rtx, attributes);
return attributes[1];
}
/* This is used in length attribute of the and_shl_scratch instruction. */
int
shl_and_scr_length (rtx insn)
{
rtx set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
int len = ashl_lshr_seq[INTVAL (XEXP (set_src, 1)) & 31].insn_count;
rtx op = XEXP (set_src, 0);
len += ashl_lshr_seq[INTVAL (XEXP (op, 1)) & 31].insn_count + 1;
op = XEXP (XEXP (op, 0), 0);
return len + ashl_lshr_seq[INTVAL (XEXP (op, 1)) & 31].insn_count;
}
/* Generate rtl for instructions for which shl_and_kind advised a particular
method of generating them, i.e. returned zero. */
bool
gen_shl_and (rtx dest, rtx left_rtx, rtx mask_rtx, rtx source)
{
int attributes[3];
unsigned HOST_WIDE_INT mask;
int kind = shl_and_kind (left_rtx, mask_rtx, attributes);
int right, total_shift;
void (*shift_gen_fun) (int, rtx *) = gen_shifty_hi_op;
right = attributes[0];
total_shift = INTVAL (left_rtx) + right;
mask = (unsigned HOST_WIDE_INT) INTVAL (mask_rtx) >> total_shift;
switch (kind)
{
default:
return true;
case 1:
{
int first = attributes[2];
rtx operands[3];
if (first < 0)
{
emit_insn ((mask << right) <= 0xff
? gen_zero_extendqisi2 (dest,
gen_lowpart (QImode, source))
: gen_zero_extendhisi2 (dest,
gen_lowpart (HImode, source)));
source = dest;
}
if (source != dest)
emit_insn (gen_movsi (dest, source));
operands[0] = dest;
if (right)
{
operands[2] = GEN_INT (right);
gen_shifty_hi_op (LSHIFTRT, operands);
}
if (first > 0)
{
operands[2] = GEN_INT (first);
gen_shifty_hi_op (ASHIFT, operands);
total_shift -= first;
mask <<= first;
}
if (first >= 0)
emit_insn (mask <= 0xff
? gen_zero_extendqisi2 (dest, gen_lowpart (QImode, dest))
: gen_zero_extendhisi2 (dest, gen_lowpart (HImode, dest)));
if (total_shift > 0)
{
operands[2] = GEN_INT (total_shift);
gen_shifty_hi_op (ASHIFT, operands);
}
break;
}
case 4:
shift_gen_fun = gen_shifty_op;
case 3:
/* If the topmost bit that matters is set, set the topmost bits
that don't matter. This way, we might be able to get a shorter
signed constant. */
if (mask & ((HOST_WIDE_INT) 1 << (31 - total_shift)))
mask |= (HOST_WIDE_INT) ~0 << (31 - total_shift);
case 2:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
if (currently_expanding_to_rtl
|| reload_in_progress || reload_completed)
{
rtx operands[3];
/* Cases 3 and 4 should be handled by this split
only while combining */
gcc_assert (kind <= 2);
if (right)
{
emit_insn (gen_lshrsi3 (dest, source, GEN_INT (right)));
source = dest;
}
emit_insn (gen_andsi3 (dest, source, GEN_INT (mask)));
if (total_shift)
{
operands[0] = dest;
operands[1] = dest;
operands[2] = GEN_INT (total_shift);
shift_gen_fun (ASHIFT, operands);
}
break;
}
else
{
int neg = 0;
if (kind != 4 && total_shift < 16)
{
neg = -ext_ashl_lshr_seq[total_shift].amount[1];
if (neg > 0)
neg -= ext_ashl_lshr_seq[total_shift].amount[2];
else
neg = 0;
}
emit_insn (gen_and_shl_scratch (dest, source,
GEN_INT (right),
GEN_INT (mask),
GEN_INT (total_shift + neg),
GEN_INT (neg)));
emit_insn (gen_movsi (dest, dest));
break;
}
}
return false;
}
/* Try to find a good way to implement the combiner pattern
[(set (match_operand:SI 0 "register_operand" "=r")
(sign_extract:SI (ashift:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "const_int_operand" "n")
(match_operand:SI 3 "const_int_operand" "n")
(const_int 0)))
(clobber (reg:SI T_REG))]
LEFT_RTX is operand 2 in the above pattern, and SIZE_RTX is operand 3.
return 0 for simple left / right shift combination.
return 1 for left shift / 8 bit sign extend / left shift.
return 2 for left shift / 16 bit sign extend / left shift.
return 3 for left shift / 8 bit sign extend / shift / sign extend.
return 4 for left shift / 16 bit sign extend / shift / sign extend.
return 5 for left shift / 16 bit sign extend / right shift
return 6 for < 8 bit sign extend / left shift.
return 7 for < 8 bit sign extend / left shift / single right shift.
If COSTP is nonzero, assign the calculated cost to *COSTP. */
int
shl_sext_kind (rtx left_rtx, rtx size_rtx, int *costp)
{
int left, size, insize, ext;
int cost = 0, best_cost;
int kind;
left = INTVAL (left_rtx);
size = INTVAL (size_rtx);
insize = size - left;
gcc_assert (insize > 0);
/* Default to left / right shift. */
kind = 0;
best_cost = ashl_lshr_seq[32 - insize].insn_count
+ ashl_lshr_seq[32 - size].insn_count;
if (size <= 16)
{
/* 16 bit shift / sign extend / 16 bit shift */
cost = ashl_lshr_seq[16 - insize].insn_count + 1
+ ashl_lshr_seq[16 - size].insn_count;
/* If ashiftrt_insns[16 - size] is 8, this choice will be overridden
below, by alternative 3 or something even better. */
if (cost < best_cost)
{
kind = 5;
best_cost = cost;
}
}
/* Try a plain sign extend between two shifts. */
for (ext = 16; ext >= insize; ext -= 8)
{
if (ext <= size)
{
cost = ext_ashl_lshr_seq[ext - insize].insn_count + 1
+ ashl_lshr_seq[size - ext].insn_count;
if (cost < best_cost)
{
kind = ext / (unsigned) 8;
best_cost = cost;
}
}
/* Check if we can do a sloppy shift with a final signed shift
restoring the sign. */
if (EXT_SHIFT_SIGNED (size - ext))
cost = ext_ashl_lshr_seq[ext - insize].insn_count
+ ext_ashl_lshr_seq[size - ext].insn_count + 1;
/* If not, maybe it's still cheaper to do the second shift sloppy,
and do a final sign extend? */
else if (size <= 16)
cost = ext_ashl_lshr_seq[ext - insize].insn_count + 1
+ ext_ashl_lshr_seq[size > ext ? size - ext : ext - size].insn_count
+ 1;
else
continue;
if (cost < best_cost)
{
kind = ext / (unsigned) 8 + 2;
best_cost = cost;
}
}
/* Check if we can sign extend in r0 */
if (insize < 8)
{
cost = 3 + ashl_lshr_seq[left].insn_count;
if (cost < best_cost)
{
kind = 6;
best_cost = cost;
}
/* Try the same with a final signed shift. */
if (left < 31)
{
cost = 3 + ext_ashl_lshr_seq[left + 1].insn_count + 1;
if (cost < best_cost)
{
kind = 7;
best_cost = cost;
}
}
}
if (TARGET_DYNSHIFT)
{
/* Try to use a dynamic shift. */
cost = ashl_lshr_seq[32 - insize].insn_count + 1 + SH_DYNAMIC_SHIFT_COST;
if (cost < best_cost)
{
kind = 0;
best_cost = cost;
}
}
if (costp)
*costp = cost;
return kind;
}
/* Function to be used in the length attribute of the instructions
implementing this pattern. */
int
shl_sext_length (rtx insn)
{
rtx set_src, left_rtx, size_rtx;
int cost;
set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
left_rtx = XEXP (XEXP (set_src, 0), 1);
size_rtx = XEXP (set_src, 1);
shl_sext_kind (left_rtx, size_rtx, &cost);
return cost;
}
/* Generate rtl for this pattern */
bool
gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source)
{
int kind;
int left, size, insize, cost;
rtx operands[3];
kind = shl_sext_kind (left_rtx, size_rtx, &cost);
left = INTVAL (left_rtx);
size = INTVAL (size_rtx);
insize = size - left;
switch (kind)
{
case 1:
case 2:
case 3:
case 4:
{
int ext = kind & 1 ? 8 : 16;
int shift2 = size - ext;
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
emit_insn (gen_movsi (dest, source));
break;
}
if (dest != source)
emit_insn (gen_movsi (dest, source));
operands[0] = dest;
if (ext - insize)
{
operands[2] = GEN_INT (ext - insize);
gen_shifty_hi_op (ASHIFT, operands);
}
emit_insn (kind & 1
? gen_extendqisi2 (dest, gen_lowpart (QImode, dest))
: gen_extendhisi2 (dest, gen_lowpart (HImode, dest)));
if (kind <= 2)
{
if (shift2)
{
operands[2] = GEN_INT (shift2);
gen_shifty_op (ASHIFT, operands);
}
}
else
{
if (shift2 > 0)
{
if (EXT_SHIFT_SIGNED (shift2))
{
operands[2] = GEN_INT (shift2 + 1);
gen_shifty_op (ASHIFT, operands);
operands[2] = const1_rtx;
gen_shifty_op (ASHIFTRT, operands);
break;
}
operands[2] = GEN_INT (shift2);
gen_shifty_hi_op (ASHIFT, operands);
}
else if (shift2)
{
operands[2] = GEN_INT (-shift2);
gen_shifty_hi_op (LSHIFTRT, operands);
}
emit_insn (size <= 8
? gen_extendqisi2 (dest, gen_lowpart (QImode, dest))
: gen_extendhisi2 (dest, gen_lowpart (HImode, dest)));
}
break;
}
case 5:
{
int i = 16 - size;
if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
else
{
operands[0] = dest;
operands[2] = GEN_INT (16 - insize);
gen_shifty_hi_op (ASHIFT, operands);
emit_insn (gen_extendhisi2 (dest, gen_lowpart (HImode, dest)));
}
/* Don't use gen_ashrsi3 because it generates new pseudos. */
while (--i >= 0)
gen_ashift (ASHIFTRT, 1, dest);
break;
}
case 6:
case 7:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
emit_insn (gen_movsi (dest, source));
break;
}
emit_insn (gen_andsi3 (dest, source, GEN_INT ((1 << insize) - 1)));
emit_insn (gen_xorsi3 (dest, dest, GEN_INT (1 << (insize - 1))));
emit_insn (gen_addsi3 (dest, dest, GEN_INT (-1 << (insize - 1))));
operands[0] = dest;
operands[2] = kind == 7 ? GEN_INT (left + 1) : left_rtx;
gen_shifty_op (ASHIFT, operands);
if (kind == 7)
emit_insn (gen_ashrsi3_k (dest, dest, const1_rtx));
break;
default:
return true;
}
return false;
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* Prefix a symbol_ref name with "datalabel". */
rtx
gen_datalabel_ref (rtx sym)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
const char *str;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (GET_CODE (sym) == LABEL_REF)
return gen_rtx_CONST (GET_MODE (sym),
gen_rtx_UNSPEC (GET_MODE (sym),
gen_rtvec (1, sym),
UNSPEC_DATALABEL));
gcc_assert (GET_CODE (sym) == SYMBOL_REF);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
str = XSTR (sym, 0);
/* Share all SYMBOL_REF strings with the same value - that is important
for cse. */
str = IDENTIFIER_POINTER (get_identifier (str));
XSTR (sym, 0) = str;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return sym;
}
1995-04-21 03:19:27 +02:00
static alloc_pool label_ref_list_pool;
typedef struct label_ref_list_d
{
rtx label;
struct label_ref_list_d *next;
} *label_ref_list_t;
1995-04-21 03:19:27 +02:00
/* The SH cannot load a large constant into a register, constants have to
come from a pc relative load. The reference of a pc relative load
instruction must be less than 1k in front of the instruction. This
1995-04-21 03:19:27 +02:00
means that we often have to dump a constant inside a function, and
generate code to branch around it.
1993-04-30 16:29:19 +02:00
1995-04-21 03:19:27 +02:00
It is important to minimize this, since the branches will slow things
down and make things bigger.
Worst case code looks like:
mov.l L1,rn
bra L2
nop
align
L1: .long value
L2:
..
mov.l L3,rn
bra L4
nop
align
L3: .long value
L4:
..
We fix this by performing a scan before scheduling, which notices which
instructions need to have their operands fetched from the constant table
and builds the table.
The algorithm is:
scan, find an instruction which needs a pcrel move. Look forward, find the
last barrier which is within MAX_COUNT bytes of the requirement.
If there isn't one, make one. Process all the instructions between
the find and the barrier.
In the above example, we can tell that L3 is within 1k of L1, so
the first move can be shrunk from the 3 insn+constant sequence into
just 1 insn, and the constant moved to L3 to make:
mov.l L1,rn
..
mov.l L3,rn
bra L4
nop
align
L3:.long value
L4:.long value
Then the second move becomes the target for the shortening process. */
typedef struct
{
rtx value; /* Value in table. */
rtx label; /* Label of value. */
label_ref_list_t wend; /* End of window. */
1995-04-21 03:19:27 +02:00
enum machine_mode mode; /* Mode of value. */
/* True if this constant is accessed as part of a post-increment
sequence. Note that HImode constants are never accessed in this way. */
bool part_of_sequence_p;
1995-04-21 03:19:27 +02:00
} pool_node;
/* The maximum number of constants that can fit into one pool, since
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
constants in the range 0..510 are at least 2 bytes long, and in the
range from there to 1018 at least 4 bytes. */
1995-04-21 03:19:27 +02:00
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
#define MAX_POOL_SIZE 372
1995-04-21 03:19:27 +02:00
static pool_node pool_vector[MAX_POOL_SIZE];
static int pool_size;
static rtx pool_window_label;
static int pool_window_last;
1995-04-21 03:19:27 +02:00
static int max_labelno_before_reorg;
1995-04-21 03:19:27 +02:00
/* ??? If we need a constant in HImode which is the truncated value of a
constant we need in SImode, we could combine the two entries thus saving
two bytes. Is this common enough to be worth the effort of implementing
it? */
/* ??? This stuff should be done at the same time that we shorten branches.
As it is now, we must assume that all branches are the maximum size, and
this causes us to almost always output constant pools sooner than
necessary. */
/* Add a constant to the pool and return its label. */
static rtx
add_constant (rtx x, enum machine_mode mode, rtx last_value)
{
int i;
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 lab, new_rtx;
label_ref_list_t ref, newref;
1995-04-21 03:19:27 +02:00
/* First see if we've already got it. */
for (i = 0; i < pool_size; i++)
{
1995-04-21 03:19:27 +02:00
if (x->code == pool_vector[i].value->code
&& mode == pool_vector[i].mode)
{
1995-04-21 03:19:27 +02:00
if (x->code == CODE_LABEL)
{
if (XINT (x, 3) != XINT (pool_vector[i].value, 3))
continue;
}
if (rtx_equal_p (x, pool_vector[i].value))
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +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
lab = new_rtx = 0;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (! last_value
|| ! i
|| ! rtx_equal_p (last_value, pool_vector[i-1].value))
{
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
new_rtx = gen_label_rtx ();
LABEL_REFS (new_rtx) = pool_vector[i].label;
pool_vector[i].label = lab = new_rtx;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
if (lab && pool_window_label)
{
newref = (label_ref_list_t) pool_alloc (label_ref_list_pool);
newref->label = pool_window_label;
ref = pool_vector[pool_window_last].wend;
newref->next = ref;
pool_vector[pool_window_last].wend = newref;
}
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
if (new_rtx)
pool_window_label = new_rtx;
pool_window_last = i;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
return lab;
}
}
}
1993-06-29 02:10:35 +02:00
1995-04-21 03:19:27 +02:00
/* Need a new one. */
pool_vector[pool_size].value = x;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (last_value && rtx_equal_p (last_value, pool_vector[pool_size - 1].value))
{
lab = 0;
pool_vector[pool_size - 1].part_of_sequence_p = true;
}
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
else
lab = gen_label_rtx ();
1995-04-21 03:19:27 +02:00
pool_vector[pool_size].mode = mode;
pool_vector[pool_size].label = lab;
pool_vector[pool_size].wend = NULL;
pool_vector[pool_size].part_of_sequence_p = (lab == 0);
if (lab && pool_window_label)
{
newref = (label_ref_list_t) pool_alloc (label_ref_list_pool);
newref->label = pool_window_label;
ref = pool_vector[pool_window_last].wend;
newref->next = ref;
pool_vector[pool_window_last].wend = newref;
}
if (lab)
pool_window_label = lab;
pool_window_last = pool_size;
1995-04-21 03:19:27 +02:00
pool_size++;
return lab;
}
/* Output the literal table. START, if nonzero, is the first instruction
this table is needed for, and also indicates that there is at least one
casesi_worker_2 instruction; We have to emit the operand3 labels from
these insns at a 4-byte aligned position. BARRIER is the barrier
after which we are to place the table. */
1993-06-29 02:10:35 +02:00
static void
dump_table (rtx start, rtx barrier)
1993-06-29 02:10:35 +02:00
{
rtx scan = barrier;
int i;
bool need_align = true;
rtx lab;
label_ref_list_t ref;
bool have_df = false;
1993-06-29 02:10:35 +02:00
/* Do two passes, first time dump out the HI sized constants. */
1993-06-29 02:10:35 +02:00
for (i = 0; i < pool_size; i++)
1993-06-29 02:10:35 +02:00
{
1995-04-21 03:19:27 +02:00
pool_node *p = &pool_vector[i];
if (p->mode == HImode)
{
if (need_align)
{
scan = emit_insn_after (gen_align_2 (), scan);
need_align = false;
}
for (lab = p->label; lab; lab = LABEL_REFS (lab))
scan = emit_label_after (lab, scan);
scan = emit_insn_after (gen_consttable_2 (p->value, const0_rtx),
scan);
for (ref = p->wend; ref; ref = ref->next)
{
lab = ref->label;
scan = emit_insn_after (gen_consttable_window_end (lab), scan);
}
}
else if (p->mode == DFmode)
have_df = true;
1993-06-29 02:10:35 +02:00
}
1995-04-21 03:19:27 +02:00
need_align = true;
1993-06-29 02:10:35 +02:00
if (start)
{
scan = emit_insn_after (gen_align_4 (), scan);
need_align = false;
for (; start != barrier; start = NEXT_INSN (start))
if (NONJUMP_INSN_P (start)
&& recog_memoized (start) == CODE_FOR_casesi_worker_2)
{
rtx src = SET_SRC (XVECEXP (PATTERN (start), 0, 0));
rtx lab = XEXP (XVECEXP (src, 0, 3), 0);
scan = emit_label_after (lab, scan);
}
}
if (TARGET_FMOVD && TARGET_ALIGN_DOUBLE && have_df)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
rtx align_insn = NULL_RTX;
scan = emit_label_after (gen_label_rtx (), scan);
scan = emit_insn_after (gen_align_log (GEN_INT (3)), scan);
need_align = false;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
for (i = 0; i < pool_size; i++)
{
pool_node *p = &pool_vector[i];
switch (p->mode)
{
case HImode:
break;
case SImode:
case SFmode:
if (align_insn && !p->part_of_sequence_p)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
for (lab = p->label; lab; lab = LABEL_REFS (lab))
emit_label_before (lab, align_insn);
emit_insn_before (gen_consttable_4 (p->value, const0_rtx),
align_insn);
for (ref = p->wend; ref; ref = ref->next)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
lab = ref->label;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
emit_insn_before (gen_consttable_window_end (lab),
align_insn);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
delete_insn (align_insn);
align_insn = NULL_RTX;
continue;
}
else
{
for (lab = p->label; lab; lab = LABEL_REFS (lab))
scan = emit_label_after (lab, scan);
scan = emit_insn_after (gen_consttable_4 (p->value,
const0_rtx), scan);
need_align = ! need_align;
}
break;
case DFmode:
if (need_align)
{
scan = emit_insn_after (gen_align_log (GEN_INT (3)), scan);
align_insn = scan;
need_align = false;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
case DImode:
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
for (lab = p->label; lab; lab = LABEL_REFS (lab))
scan = emit_label_after (lab, scan);
scan = emit_insn_after (gen_consttable_8 (p->value, const0_rtx),
scan);
break;
default:
gcc_unreachable ();
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
if (p->mode != HImode)
{
for (ref = p->wend; ref; ref = ref->next)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
lab = ref->label;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
scan = emit_insn_after (gen_consttable_window_end (lab),
scan);
}
}
}
pool_size = 0;
}
for (i = 0; i < pool_size; i++)
1993-06-29 02:10:35 +02:00
{
1995-04-21 03:19:27 +02:00
pool_node *p = &pool_vector[i];
1993-06-29 02:10:35 +02:00
switch (p->mode)
1993-06-29 02:10:35 +02:00
{
case HImode:
break;
case SImode:
case SFmode:
if (need_align)
1993-06-29 02:10:35 +02:00
{
need_align = false;
scan = emit_label_after (gen_label_rtx (), scan);
scan = emit_insn_after (gen_align_4 (), scan);
1993-06-29 02:10:35 +02:00
}
for (lab = p->label; lab; lab = LABEL_REFS (lab))
scan = emit_label_after (lab, scan);
scan = emit_insn_after (gen_consttable_4 (p->value, const0_rtx),
scan);
break;
case DFmode:
case DImode:
if (need_align)
{
need_align = false;
scan = emit_label_after (gen_label_rtx (), scan);
scan = emit_insn_after (gen_align_4 (), scan);
}
for (lab = p->label; lab; lab = LABEL_REFS (lab))
scan = emit_label_after (lab, scan);
scan = emit_insn_after (gen_consttable_8 (p->value, const0_rtx),
scan);
break;
default:
gcc_unreachable ();
1993-06-29 02:10:35 +02:00
}
if (p->mode != HImode)
{
for (ref = p->wend; ref; ref = ref->next)
{
lab = ref->label;
scan = emit_insn_after (gen_consttable_window_end (lab), scan);
}
}
1993-06-29 02:10:35 +02:00
}
scan = emit_insn_after (gen_consttable_end (), scan);
scan = emit_barrier_after (scan);
pool_size = 0;
pool_window_label = NULL_RTX;
pool_window_last = 0;
}
1993-06-29 02:10:35 +02:00
#define MOVA_LABELREF(mova) XVECEXP (SET_SRC (PATTERN (mova)), 0, 0)
/* Nonzero if the insn is a move instruction which needs to be fixed. */
1995-04-21 03:19:27 +02:00
/* ??? For a DImode/DFmode moves, we don't need to fix it if each half of the
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
CONST_DOUBLE input value is CONST_OK_FOR_I08. For a SFmode move, we don't
need to fix it if the input value is CONST_OK_FOR_I08. */
1995-04-21 03:19:27 +02:00
static bool
broken_move (rtx insn)
1993-06-29 02:10:35 +02:00
{
if (NONJUMP_INSN_P (insn))
{
rtx pat = PATTERN (insn);
if (GET_CODE (pat) == PARALLEL)
pat = XVECEXP (pat, 0, 0);
if (GET_CODE (pat) == SET
/* We can load any 8-bit value if we don't care what the high
order bits end up as. */
&& GET_MODE (SET_DEST (pat)) != QImode
&& (CONSTANT_P (SET_SRC (pat))
/* Match mova_const. */
|| (GET_CODE (SET_SRC (pat)) == UNSPEC
&& XINT (SET_SRC (pat), 1) == UNSPEC_MOVA
&& GET_CODE (XVECEXP (SET_SRC (pat), 0, 0)) == CONST))
&& ! (TARGET_SH2E
&& GET_CODE (SET_SRC (pat)) == CONST_DOUBLE
&& (fp_zero_operand (SET_SRC (pat))
|| fp_one_operand (SET_SRC (pat)))
/* In general we don't know the current setting of fpscr, so disable fldi.
There is an exception if this was a register-register move
before reload - and hence it was ascertained that we have
single precision setting - and in a post-reload optimization
we changed this to do a constant load. In that case
we don't have an r0 clobber, hence we must use fldi. */
&& (TARGET_FMOVD
|| (GET_CODE (XEXP (XVECEXP (PATTERN (insn), 0, 2), 0))
== SCRATCH))
&& REG_P (SET_DEST (pat))
&& FP_REGISTER_P (REGNO (SET_DEST (pat))))
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
&& ! (TARGET_SH2A
&& GET_MODE (SET_DEST (pat)) == SImode
&& (satisfies_constraint_I20 (SET_SRC (pat))
|| satisfies_constraint_I28 (SET_SRC (pat))))
constraints.md: New file. * config/sh/constraints.md: New file. * config/sh/sh.c: Include tm-constrs.h. (reg_class_from_letter): Remove. (prepare_cbranch_operands): Use satisfies_constraint_* function instead of macro. (andcosts, broken_move, sh_secondary_reload): Likewise. * config/sh/predicates.md (trapping_target_operand): Likewise. (and_operand, arith_operand, arith_reg_or_0_operand, cmp_operand, logical_operand, target_operand, ua_address_operand, ua_offset, xor_operand): Likewise. * config/sh/sh.md: Include constraints.md. (*movsicc_t_false): Use satisfies_constraint_* function instead of macro. (*movsicc_t_true, ashlsi3_std, ashlhi3_k, lshrsi3_m, lshrsi3_k, movsi_const_16bit+2, *movhi_media+1, movdi_const_16bit+1, beq, bne, *ptb): Likewise. * config/sh/sh.h (reg_class_from_letter): Remove prototype. (OVERRIDE_OPTIONS): Don't modify reg_class_from_letter. (REG_CLASS_FROM_CONSTRAINT): Remove. (CONSTRAINT_LEN, CONST_OK_FOR_I20, CONST_OK_FOR_I, CONST_OK_FOR_J, CONST_OK_FOR_K16, CONST_OK_FOR_K, CONST_OK_FOR_P27, CONST_OK_FOR_P, CONST_OK_FOR_M, CONST_OK_FOR_N, CONST_OK_FOR_CONSTRAINT_P, CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. (SECONDARY_INOUT_RELOAD_CLASS): Use satisfies_constraint_* function instead of macro. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (EXTRA_CONSTRAINT_Q, EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc, EXTRA_CONSTRAINT_B, EXTRA_CONSTRAINT_Css, EXTRA_CONSTRAINT_Csu): Remove. (IS_PC_RELATIVE_LOAD_ADDR_P): New macro. (IS_LITERAL_OR_SYMBOLIC_S16_P): Likewise. (IS_LITERAL_OR_SYMBOLIC_U16_P): Likewise. (IS_NON_EXPLICIT_CONSTANT_P): Likewise. (EXTRA_CONSTRAINT_Csy, EXTRA_CONSTRAINT_Z, EXTRA_CONSTRAINT_W, EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C, EXTRA_MEMORY_CONSTRAINT, EXTRA_CONSTRAINT_Sr0, EXTRA_CONSTRAINT_Sua, EXTRA_CONSTRAINT_S, EXTRA_CONSTRAINT_STR): Likewise. (GO_IF_LEGITIMATE_INDEX): Fix indentation. From-SVN: r125561
2007-06-08 08:59:55 +02:00
&& ! satisfies_constraint_I08 (SET_SRC (pat)))
return true;
}
return false;
1993-06-29 02:10:35 +02:00
}
static bool
mova_p (rtx insn)
{
return (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SET
&& GET_CODE (SET_SRC (PATTERN (insn))) == UNSPEC
&& XINT (SET_SRC (PATTERN (insn)), 1) == UNSPEC_MOVA
/* Don't match mova_const. */
&& GET_CODE (MOVA_LABELREF (insn)) == LABEL_REF);
}
/* Fix up a mova from a switch that went out of range. */
static void
fixup_mova (rtx mova)
{
PUT_MODE (XEXP (MOVA_LABELREF (mova), 0), QImode);
if (! flag_pic)
{
SET_SRC (PATTERN (mova)) = MOVA_LABELREF (mova);
INSN_CODE (mova) = -1;
}
else
{
rtx worker = mova;
rtx lab = gen_label_rtx ();
sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. gcc/ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete. (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P. (PIC_OFFSET_P): Rename to... (PCREL_SYMOFF_P): ...this. (PIC_DIRECT_ADDR_P): Delete. (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of PIC_OFFSET_P. (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16, UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (print_operand): Remove CONST handling. (unspec_caller_rtx_p): Rewrite to use split_const and check the operands of UNSPEC bases. (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC) with (unspec [A B] UNSPEC_SYMOFF). (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec. (UNSPEC_EXTRACT_U16): Likewise. (UNSPEC_SYMOFF): Likewise. (UNSPEC_PCREL_SYMOFF): Likewise. (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions of constants. (movsi_const_16bit): Likewise. (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise. (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC) with (unspec [A B] UNSPEC_PCREL_SYMOFF). (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B) with (unspec [A B] UNSPEC_SYMOFF). (symPLT_label2reg): Replace (minus A (minus B pc)) with (unspec [A B] PCREL_UNSPEC_SYMOFF). * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16. (Csu): Likewise UNSPEC_EXTRACT_U16. (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P. From-SVN: r141046
2008-10-10 20:28:25 +02:00
rtx wpat, wpat0, wpat1, wsrc, target, base, diff;
do
{
worker = NEXT_INSN (worker);
gcc_assert (worker
&& !LABEL_P (worker)
&& !JUMP_P (worker));
} while (NOTE_P (worker)
|| recog_memoized (worker) != CODE_FOR_casesi_worker_1);
wpat = PATTERN (worker);
wpat0 = XVECEXP (wpat, 0, 0);
wpat1 = XVECEXP (wpat, 0, 1);
wsrc = SET_SRC (wpat0);
PATTERN (worker) = (gen_casesi_worker_2
(SET_DEST (wpat0), XVECEXP (wsrc, 0, 1),
XEXP (XVECEXP (wsrc, 0, 2), 0), lab,
XEXP (wpat1, 0)));
INSN_CODE (worker) = -1;
sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. gcc/ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete. (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P. (PIC_OFFSET_P): Rename to... (PCREL_SYMOFF_P): ...this. (PIC_DIRECT_ADDR_P): Delete. (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of PIC_OFFSET_P. (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16, UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (print_operand): Remove CONST handling. (unspec_caller_rtx_p): Rewrite to use split_const and check the operands of UNSPEC bases. (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC) with (unspec [A B] UNSPEC_SYMOFF). (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec. (UNSPEC_EXTRACT_U16): Likewise. (UNSPEC_SYMOFF): Likewise. (UNSPEC_PCREL_SYMOFF): Likewise. (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions of constants. (movsi_const_16bit): Likewise. (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise. (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC) with (unspec [A B] UNSPEC_PCREL_SYMOFF). (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B) with (unspec [A B] UNSPEC_SYMOFF). (symPLT_label2reg): Replace (minus A (minus B pc)) with (unspec [A B] PCREL_UNSPEC_SYMOFF). * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16. (Csu): Likewise UNSPEC_EXTRACT_U16. (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P. From-SVN: r141046
2008-10-10 20:28:25 +02:00
target = XVECEXP (SET_SRC (PATTERN (mova)), 0, 0);
base = gen_rtx_LABEL_REF (Pmode, lab);
diff = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, target, base), UNSPEC_SYMOFF);
SET_SRC (PATTERN (mova)) = gen_rtx_CONST (Pmode, diff);
INSN_CODE (mova) = -1;
}
}
/* NEW_MOVA is a mova we've just encountered while scanning forward. Update
*num_mova, and check if the new mova is not nested within the first one.
return 0 if *first_mova was replaced, 1 if new_mova was replaced,
2 if new_mova has been assigned to *first_mova, -1 otherwise.. */
static int
untangle_mova (int *num_mova, rtx *first_mova, rtx new_mova)
{
int n_addr = 0; /* Initialization to shut up spurious warning. */
int f_target, n_target = 0; /* Likewise. */
if (optimize)
{
/* If NEW_MOVA has no address yet, it will be handled later. */
if (INSN_ADDRESSES_SIZE() <= (unsigned) INSN_UID (new_mova))
return -1;
n_addr = INSN_ADDRESSES (INSN_UID (new_mova));
n_target = INSN_ADDRESSES (INSN_UID (XEXP (MOVA_LABELREF (new_mova), 0)));
if (n_addr > n_target || n_addr + 1022 < n_target)
{
/* Change the mova into a load.
broken_move will then return true for it. */
fixup_mova (new_mova);
return 1;
}
}
if (!(*num_mova)++)
{
*first_mova = new_mova;
return 2;
}
if (!optimize
|| ((f_target
= INSN_ADDRESSES (INSN_UID (XEXP (MOVA_LABELREF (*first_mova), 0))))
>= n_target))
return -1;
(*num_mova)--;
if (f_target - INSN_ADDRESSES (INSN_UID (*first_mova))
> n_target - n_addr)
{
fixup_mova (*first_mova);
return 0;
}
else
{
fixup_mova (new_mova);
return 1;
}
}
1995-04-21 03:19:27 +02:00
/* Find the last barrier from insn FROM which is close enough to hold the
constant pool. If we can't find one, then create one near the end of
the range. */
1993-06-29 02:10:35 +02:00
1995-04-21 03:19:27 +02:00
static rtx
find_barrier (int num_mova, rtx mova, rtx from)
1993-06-29 02:10:35 +02:00
{
int count_si = 0;
int count_hi = 0;
int found_hi = 0;
int found_si = 0;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
int found_di = 0;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
int hi_align = 2;
int si_align = 2;
int leading_mova = num_mova;
rtx barrier_before_mova = NULL_RTX;
rtx found_barrier = NULL_RTX;
rtx good_barrier = NULL_RTX;
int si_limit;
int hi_limit;
rtx orig = from;
rtx last_got = NULL_RTX;
rtx last_symoff = NULL_RTX;
1995-04-21 03:19:27 +02:00
/* For HImode: range is 510, add 4 because pc counts from address of
second instruction after this one, subtract 2 for the jump instruction
that we may need to emit before the table, subtract 2 for the instruction
that fills the jump delay slot (in very rare cases, reorg will take an
instruction from after the constant pool or will leave the delay slot
empty). This gives 510.
1995-04-21 03:19:27 +02:00
For SImode: range is 1020, add 4 because pc counts from address of
second instruction after this one, subtract 2 in case pc is 2 byte
aligned, subtract 2 for the jump instruction that we may need to emit
before the table, subtract 2 for the instruction that fills the jump
delay slot. This gives 1018. */
/* The branch will always be shortened now that the reference address for
1997-12-07 01:31:01 +01:00
forward branches is the successor address, thus we need no longer make
adjustments to the [sh]i_limit for -O0. */
si_limit = 1018;
hi_limit = 510;
while (from && count_si < si_limit && count_hi < hi_limit)
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
int inc = get_attr_length (from);
int new_align = 1;
/* If this is a label that existed at the time of the compute_alignments
call, determine the alignment. N.B. When find_barrier recurses for
an out-of-reach mova, we might see labels at the start of previously
inserted constant tables. */
if (LABEL_P (from)
&& CODE_LABEL_NUMBER (from) <= max_labelno_before_reorg)
{
if (optimize)
new_align = 1 << label_to_alignment (from);
else if (BARRIER_P (prev_nonnote_insn (from)))
new_align = 1 << barrier_align (from);
else
new_align = 1;
inc = 0;
}
/* In case we are scanning a constant table because of recursion, check
for explicit alignments. If the table is long, we might be forced
to emit the new table in front of it; the length of the alignment
might be the last straw. */
else if (NONJUMP_INSN_P (from)
&& GET_CODE (PATTERN (from)) == UNSPEC_VOLATILE
&& XINT (PATTERN (from), 1) == UNSPECV_ALIGN)
new_align = INTVAL (XVECEXP (PATTERN (from), 0, 0));
/* When we find the end of a constant table, paste the new constant
at the end. That is better than putting it in front because
this way, we don't need extra alignment for adding a 4-byte-aligned
mov(a) label to a 2/4 or 8/4 byte aligned table. */
else if (NONJUMP_INSN_P (from)
&& GET_CODE (PATTERN (from)) == UNSPEC_VOLATILE
&& XINT (PATTERN (from), 1) == UNSPECV_CONST_END)
return from;
1995-04-21 03:19:27 +02:00
if (BARRIER_P (from))
{
rtx next;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
found_barrier = from;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
1997-12-07 01:31:01 +01:00
/* If we are at the end of the function, or in front of an alignment
instruction, we need not insert an extra alignment. We prefer
this kind of barrier. */
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (barrier_align (from) > 2)
good_barrier = from;
/* If we are at the end of a hot/cold block, dump the constants
here. */
next = NEXT_INSN (from);
if (next
&& NOTE_P (next)
&& NOTE_KIND (next) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
break;
}
1995-04-21 03:19:27 +02:00
if (broken_move (from))
{
rtx pat, src, dst;
enum machine_mode mode;
pat = PATTERN (from);
if (GET_CODE (pat) == PARALLEL)
pat = XVECEXP (pat, 0, 0);
src = SET_SRC (pat);
dst = SET_DEST (pat);
mode = GET_MODE (dst);
/* GOT pcrelat setting comes in pair of
mova .L8,r0
mov.l .L8,r12
instructions. (plus add r0,r12).
Remember if we see one without the other. */
if (GET_CODE (src) == UNSPEC && PIC_ADDR_P (XVECEXP (src, 0, 0)))
last_got = last_got ? NULL_RTX : from;
else if (PIC_ADDR_P (src))
last_got = last_got ? NULL_RTX : from;
/* We must explicitly check the mode, because sometimes the
front end will generate code to load unsigned constants into
HImode targets without properly sign extending them. */
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (mode == HImode
|| (mode == SImode && satisfies_constraint_I16 (src)
&& REGNO (dst) != FPUL_REG))
{
found_hi += 2;
/* We put the short constants before the long constants, so
we must count the length of short constants in the range
for the long constants. */
/* ??? This isn't optimal, but is easy to do. */
si_limit -= 2;
}
else
{
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* We dump DF/DI constants before SF/SI ones, because
the limit is the same, but the alignment requirements
are higher. We may waste up to 4 additional bytes
for alignment, and the DF/DI constant may have
another SF/SI constant placed before it. */
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHCOMPACT
&& ! found_di
&& (mode == DFmode || mode == DImode))
{
found_di = 1;
si_limit -= 8;
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
while (si_align > 2 && found_si + si_align - 2 > count_si)
si_align >>= 1;
if (found_si > count_si)
count_si = found_si;
found_si += GET_MODE_SIZE (mode);
if (num_mova)
si_limit -= GET_MODE_SIZE (mode);
}
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (mova_p (from))
{
switch (untangle_mova (&num_mova, &mova, from))
{
case 1:
if (flag_pic)
{
rtx src = SET_SRC (PATTERN (from));
if (GET_CODE (src) == CONST
&& GET_CODE (XEXP (src, 0)) == UNSPEC
&& XINT (XEXP (src, 0), 1) == UNSPEC_SYMOFF)
last_symoff = from;
}
break;
case 0: return find_barrier (0, 0, mova);
case 2:
{
leading_mova = 0;
barrier_before_mova
= good_barrier ? good_barrier : found_barrier;
}
default: break;
}
if (found_si > count_si)
count_si = found_si;
}
else if (JUMP_TABLE_DATA_P (from))
{
if ((num_mova > 1 && GET_MODE (prev_nonnote_insn (from)) == VOIDmode)
|| (num_mova
&& (prev_nonnote_insn (from)
== XEXP (MOVA_LABELREF (mova), 0))))
num_mova--;
if (barrier_align (next_real_insn (from)) == align_jumps_log)
{
1998-05-06 23:09:07 +02:00
/* We have just passed the barrier in front of the
ADDR_DIFF_VEC, which is stored in found_barrier. Since
the ADDR_DIFF_VEC is accessed as data, just like our pool
constants, this is a good opportunity to accommodate what
we have gathered so far.
If we waited any longer, we could end up at a barrier in
front of code, which gives worse cache usage for separated
instruction / data caches. */
good_barrier = found_barrier;
break;
}
else
{
rtx body = PATTERN (from);
inc = XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body));
}
}
/* For the SH1, we generate alignments even after jumps-around-jumps. */
else if (JUMP_P (from)
&& ! TARGET_SH2
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
&& ! optimize_size)
new_align = 4;
/* There is a possibility that a bf is transformed into a bf/s by the
delay slot scheduler. */
if (JUMP_P (from) && !JUMP_TABLE_DATA_P (from)
&& get_attr_type (from) == TYPE_CBRANCH
&& ! sequence_insn_p (from))
inc += 2;
if (found_si)
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
{
count_si += inc;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (new_align > si_align)
{
si_limit -= (count_si - 1) & (new_align - si_align);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
si_align = new_align;
}
count_si = (count_si + new_align - 1) & -new_align;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
}
if (found_hi)
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
{
count_hi += inc;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (new_align > hi_align)
{
hi_limit -= (count_hi - 1) & (new_align - hi_align);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
hi_align = new_align;
}
count_hi = (count_hi + new_align - 1) & -new_align;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
}
from = NEXT_INSN (from);
}
if (num_mova)
{
if (leading_mova)
{
/* Try as we might, the leading mova is out of range. Change
it into a load (which will become a pcload) and retry. */
fixup_mova (mova);
return find_barrier (0, 0, mova);
}
else
{
/* Insert the constant pool table before the mova instruction,
to prevent the mova label reference from going out of range. */
from = mova;
good_barrier = found_barrier = barrier_before_mova;
}
}
if (found_barrier)
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (good_barrier && next_real_insn (found_barrier))
found_barrier = good_barrier;
}
else
1993-06-29 02:10:35 +02:00
{
1995-04-21 03:19:27 +02:00
/* We didn't find a barrier in time to dump our stuff,
so we'll make one. */
rtx label = gen_label_rtx ();
1995-04-21 03:19:27 +02:00
/* Don't emit a constant table in the middle of insns for
casesi_worker_2. This is a bit overkill but is enough
because casesi_worker_2 wouldn't appear so frequently. */
if (last_symoff)
from = last_symoff;
/* If we exceeded the range, then we must back up over the last
instruction we looked at. Otherwise, we just need to undo the
NEXT_INSN at the end of the loop. */
if (PREV_INSN (from) != orig
&& (count_hi > hi_limit || count_si > si_limit))
from = PREV_INSN (PREV_INSN (from));
else
from = PREV_INSN (from);
/* Don't emit a constant table int the middle of global pointer setting,
since that that would move the addressing base GOT into another table.
We need the first mov instruction before the _GLOBAL_OFFSET_TABLE_
in the pool anyway, so just move up the whole constant pool.
However, avoid doing so when the last single GOT mov is the starting
insn itself. Going past above the start insn would create a negative
offset, causing errors. */
if (last_got && last_got != orig)
from = PREV_INSN (last_got);
/* Don't insert the constant pool table at the position which
may be the landing pad. */
if (flag_exceptions
&& CALL_P (from)
&& find_reg_note (from, REG_EH_REGION, NULL_RTX))
from = PREV_INSN (from);
1995-04-21 03:19:27 +02:00
/* Walk back to be just before any jump or label.
Putting it before a label reduces the number of times the branch
around the constant pool table will be hit. Putting it before
a jump makes it more likely that the bra delay slot will be
filled. */
while (NOTE_P (from) || JUMP_P (from)
|| LABEL_P (from))
1995-04-21 03:19:27 +02:00
from = PREV_INSN (from);
/* Make sure we do not split between a call and its corresponding
CALL_ARG_LOCATION note. */
if (CALL_P (from))
{
rtx next = NEXT_INSN (from);
if (next && NOTE_P (next)
&& NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
from = next;
}
from = emit_jump_insn_after (gen_jump (label), from);
JUMP_LABEL (from) = label;
LABEL_NUSES (label) = 1;
found_barrier = emit_barrier_after (from);
emit_label_after (label, found_barrier);
1993-06-29 02:10:35 +02:00
}
1995-04-21 03:19:27 +02:00
return found_barrier;
}
1993-06-29 02:10:35 +02:00
/* If the instruction INSN is implemented by a special function, and we can
positively find the register that is used to call the sfunc, and this
register is not used anywhere else in this instruction - except as the
destination of a set, return this register; else, return 0. */
rtx
sfunc_uses_reg (rtx insn)
{
int i;
rtx pattern, part, reg_part, reg;
if (!NONJUMP_INSN_P (insn))
return NULL_RTX;
pattern = PATTERN (insn);
if (GET_CODE (pattern) != PARALLEL || get_attr_type (insn) != TYPE_SFUNC)
return NULL_RTX;
for (reg_part = NULL_RTX, i = XVECLEN (pattern, 0) - 1; i >= 1; i--)
{
part = XVECEXP (pattern, 0, i);
if (GET_CODE (part) == USE && GET_MODE (XEXP (part, 0)) == SImode)
reg_part = part;
}
if (! reg_part)
return NULL_RTX;
reg = XEXP (reg_part, 0);
for (i = XVECLEN (pattern, 0) - 1; i >= 0; i--)
{
part = XVECEXP (pattern, 0, i);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (part == reg_part || GET_CODE (part) == CLOBBER)
continue;
if (reg_mentioned_p (reg, ((GET_CODE (part) == SET
&& REG_P (SET_DEST (part)))
? SET_SRC (part) : part)))
return NULL_RTX;
}
return reg;
}
/* See if the only way in which INSN uses REG is by calling it, or by
setting it while calling it. Set *SET to a SET rtx if the register
is set by INSN. */
static bool
noncall_uses_reg (rtx reg, rtx insn, rtx *set)
{
rtx pattern, reg2;
*set = NULL_RTX;
reg2 = sfunc_uses_reg (insn);
if (reg2 && REGNO (reg2) == REGNO (reg))
{
pattern = single_set (insn);
if (pattern
&& REG_P (SET_DEST (pattern))
&& REGNO (reg) == REGNO (SET_DEST (pattern)))
*set = pattern;
return false;
}
if (!CALL_P (insn))
{
/* We don't use rtx_equal_p because we don't care if the mode is
different. */
pattern = single_set (insn);
if (pattern
&& REG_P (SET_DEST (pattern))
&& REGNO (reg) == REGNO (SET_DEST (pattern)))
{
rtx par, part;
int i;
*set = pattern;
par = PATTERN (insn);
if (GET_CODE (par) == PARALLEL)
for (i = XVECLEN (par, 0) - 1; i >= 0; i--)
{
part = XVECEXP (par, 0, i);
if (GET_CODE (part) != SET && reg_mentioned_p (reg, part))
return true;
}
return reg_mentioned_p (reg, SET_SRC (pattern));
}
return true;
}
pattern = PATTERN (insn);
if (GET_CODE (pattern) == PARALLEL)
{
int i;
for (i = XVECLEN (pattern, 0) - 1; i >= 1; i--)
if (reg_mentioned_p (reg, XVECEXP (pattern, 0, i)))
return true;
pattern = XVECEXP (pattern, 0, 0);
}
if (GET_CODE (pattern) == SET)
{
if (reg_mentioned_p (reg, SET_DEST (pattern)))
{
/* We don't use rtx_equal_p, because we don't care if the
mode is different. */
if (!REG_P (SET_DEST (pattern))
|| REGNO (reg) != REGNO (SET_DEST (pattern)))
return true;
*set = pattern;
}
pattern = SET_SRC (pattern);
}
if (GET_CODE (pattern) != CALL
|| !MEM_P (XEXP (pattern, 0))
|| ! rtx_equal_p (reg, XEXP (XEXP (pattern, 0), 0)))
return true;
return false;
}
/* Given a X, a pattern of an insn or a part of it, return a mask of used
general registers. Bits 0..15 mean that the respective registers
are used as inputs in the instruction. Bits 16..31 mean that the
registers 0..15, respectively, are used as outputs, or are clobbered.
IS_DEST should be set to 16 if X is the destination of a SET, else to 0. */
int
regs_used (rtx x, int is_dest)
{
enum rtx_code code;
rtl.h (rtx_format): Constify a char*. * rtl.h (rtx_format): Constify a char*. * rtl.c (rtx_format): Likewise. (copy_rtx, copy_most_rtx, read_rtx): Likewise. (init_rtl): Use accessor macro, not `rtx_format'. * alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a char*. * caller-save.c (mark_referenced_regs): Likewise. * combine.c (subst, make_compound_operation, known_cond, gen_rtx_combine, update_table_tick, get_last_value_validate, use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise. * cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p, refers_to_p, canon_reg, fold_rtx, cse_process_notes, count_reg_usage): Likewise. * emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags): Likewise. * final.c (leaf_renumber_regs_insn): Likewise. * flow.c (mark_used_regs, find_use_as_address, dump_flow_info, dump_edge_info, count_reg_references): Likewise. * function.c (fixup_var_refs_1, walk_fixup_memory_subreg, fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1): Likewise. * gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p, oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs, add_label_notes): Likewise. * genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask, clear_struct_flag, count_sub_rtxs, count_alternatives, compares_alternatives_p, contained_in_p, walk_attr_value, write_expr_attr_cache): Likewise. * genconfig.c (walk_insn_part): Likewise. * genemit.c (max_operand_1, gen_exp): Likewise. * genextract.c (walk_rtx): Likewise. * genflags.c (num_operands): Likewise. * genoutput.c (scan_operands): Likewise. * genpeep.c (match_rtx): Likewise. * genrecog.c (add_to_sequence): Likewise. * haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths): Likewise. * integrate.c (save_constants, copy_for_inline, copy_rtx_and_substitute, subst_constants, restore_constants): Likewise. * jump.c (mark_jump_label, invert_exp, redirect_exp, rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise. * local-alloc.c (contains_replace_regs, memref_referenced_p): Likewise. * loop.c (record_excess_regs, rtx_equal_for_loop_p, add_label_notes, replace_call_address, count_nonfixed_reads, invariant_p, find_single_use_in_loop, find_mem_givs, find_life_end, maybe_eliminate_biv_1, update_reg_last_use): Likewise. * print-rtl.c (reg_names, print_rtx): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1): Likewise. * reg-stack.c (stack_regs_mentioned_p, record_label_references, record_reg_life_pat, swap_rtx_condition, goto_block_pat, print_blocks): Likewise. * regclass.c (fix_register, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (stable_but_for_p): Likewise. * reload.c (loc_mentioned_in_p, operands_match_p, find_reloads_toplevsubst_reg_equivs, find_reloads_address_1, copy_replacements, refers_to_regno_for_reload_p, refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p, reload_when_needed_name, reg_class_names, debug_reload_to_stream): Likewise. * reload1.c (eliminate_regs, scan_paradoxical_subregs, delete_address_reloads_1, count_occurrences, reload_cse_mem_conflict_p, reload_combine_note_use, add_auto_inc_notes): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p, reg_mentioned_p, regs_set_between_p, modified_between_p, modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p, rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p, may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs, jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise. * sched.c (sched_analyze_2, attach_deaths): Likewise. * stupid.c (stupid_mark_refs): Likewise. * unroll.c (remap_split_bivs): Likewise. * varasm.c (mark_constants): Likewise. * a29k/a29k.c (uses_local_reg_p): Likewise. * alpha/alpha.c (summarize_insn): Likewise. * arm/arm.c (symbol_mentioned_p, label_mentioned_p, eliminate_lr2ip): Likewise. * arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise. * i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx, reg_mentioned_in_mem): Likewise. * ns32k/ns32k.c (global_symbolic_reference_mentioned_p, symbolic_reference_mentioned_p): Likewise. * romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise. * sh/sh.c (regs_used, mark_use): Likewise. * vax/vax.c (vax_rtx_cost): Likewise. From-SVN: r28784
1999-08-21 01:05:25 +02:00
const char *fmt;
int i, used = 0;
if (! x)
return used;
code = GET_CODE (x);
switch (code)
{
case REG:
if (REGNO (x) < 16)
return (((1 << HARD_REGNO_NREGS (0, GET_MODE (x))) - 1)
<< (REGNO (x) + is_dest));
return 0;
case SUBREG:
{
rtx y = SUBREG_REG (x);
if (!REG_P (y))
break;
if (REGNO (y) < 16)
return (((1 << HARD_REGNO_NREGS (0, GET_MODE (x))) - 1)
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
<< (REGNO (y) +
subreg_regno_offset (REGNO (y),
GET_MODE (y),
SUBREG_BYTE (x),
GET_MODE (x)) + is_dest));
return 0;
}
case SET:
return regs_used (SET_SRC (x), 0) | regs_used (SET_DEST (x), 16);
case RETURN:
/* If there was a return value, it must have been indicated with USE. */
return 0x00ffff00;
case CLOBBER:
is_dest = 1;
break;
case MEM:
is_dest = 0;
break;
case CALL:
used |= 0x00ff00f0;
break;
default:
break;
}
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'E')
{
int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
used |= regs_used (XVECEXP (x, i, j), is_dest);
}
else if (fmt[i] == 'e')
used |= regs_used (XEXP (x, i), is_dest);
}
return used;
}
/* Create an instruction that prevents redirection of a conditional branch
1997-12-07 01:31:01 +01:00
to the destination of the JUMP with address ADDR.
If the branch needs to be implemented as an indirect jump, try to find
a scratch register for it.
If NEED_BLOCK is 0, don't do anything unless we need a scratch register.
If any preceding insn that doesn't fit into a delay slot is good enough,
pass 1. Pass 2 if a definite blocking insn is needed.
-1 is used internally to avoid deep recursion.
If a blocking instruction is made or recognized, return it. */
static rtx
gen_block_redirect (rtx jump, int addr, int need_block)
{
int dead = 0;
rtx prev = prev_nonnote_insn (jump);
rtx dest;
/* First, check if we already have an instruction that satisfies our need. */
if (prev && NONJUMP_INSN_P (prev) && ! INSN_DELETED_P (prev))
{
if (INSN_CODE (prev) == CODE_FOR_indirect_jump_scratch)
return prev;
if (GET_CODE (PATTERN (prev)) == USE
|| GET_CODE (PATTERN (prev)) == CLOBBER
|| get_attr_in_delay_slot (prev) == IN_DELAY_SLOT_YES)
prev = jump;
else if ((need_block &= ~1) < 0)
return prev;
else if (recog_memoized (prev) == CODE_FOR_block_branch_redirect)
need_block = 0;
}
if (GET_CODE (PATTERN (jump)) == RETURN)
{
if (! need_block)
return prev;
/* Reorg even does nasty things with return insns that cause branches
to go out of range - see find_end_label and callers. */
return emit_insn_before (gen_block_branch_redirect (const0_rtx) , jump);
}
/* We can't use JUMP_LABEL here because it might be undefined
when not optimizing. */
dest = XEXP (SET_SRC (PATTERN (jump)), 0);
/* If the branch is out of range, try to find a scratch register for it. */
if (optimize
&& (INSN_ADDRESSES (INSN_UID (dest)) - addr + (unsigned) 4092
> 4092 + 4098))
{
rtx scan;
/* Don't look for the stack pointer as a scratch register,
1997-12-07 01:31:01 +01:00
it would cause trouble if an interrupt occurred. */
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
unsigned attempt = 0x7fff, used;
int jump_left = flag_expensive_optimizations + 1;
/* It is likely that the most recent eligible instruction is wanted for
the delay slot. Therefore, find out which registers it uses, and
try to avoid using them. */
for (scan = jump; (scan = PREV_INSN (scan)); )
{
enum rtx_code code;
if (INSN_DELETED_P (scan))
continue;
code = GET_CODE (scan);
if (code == CODE_LABEL || code == JUMP_INSN)
break;
if (code == INSN
&& GET_CODE (PATTERN (scan)) != USE
&& GET_CODE (PATTERN (scan)) != CLOBBER
&& get_attr_in_delay_slot (scan) == IN_DELAY_SLOT_YES)
{
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
attempt &= ~regs_used (PATTERN (scan), 0);
break;
}
}
for (used = dead = 0, scan = JUMP_LABEL (jump);
(scan = NEXT_INSN (scan)); )
{
enum rtx_code code;
if (INSN_DELETED_P (scan))
continue;
code = GET_CODE (scan);
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 (INSN_P (scan))
{
used |= regs_used (PATTERN (scan), 0);
if (code == CALL_INSN)
used |= regs_used (CALL_INSN_FUNCTION_USAGE (scan), 0);
dead |= (used >> 16) & ~used;
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
if (dead & attempt)
{
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
dead &= attempt;
break;
}
if (code == JUMP_INSN)
{
if (jump_left-- && simplejump_p (scan))
scan = JUMP_LABEL (scan);
else
break;
}
}
}
/* Mask out the stack pointer again, in case it was
the only 'free' register we have found. */
dead &= 0x7fff;
}
/* If the immediate destination is still in range, check for possible
threading with a jump beyond the delay slot insn.
Don't check if we are called recursively; the jump has been or will be
1997-12-07 01:31:01 +01:00
checked in a different invocation then. */
else if (optimize && need_block >= 0)
{
rtx next = next_active_insn (next_active_insn (dest));
if (next && JUMP_P (next)
&& GET_CODE (PATTERN (next)) == SET
&& recog_memoized (next) == CODE_FOR_jump_compact)
{
dest = JUMP_LABEL (next);
if (dest
&& (INSN_ADDRESSES (INSN_UID (dest)) - addr + (unsigned) 4092
> 4092 + 4098))
gen_block_redirect (next, INSN_ADDRESSES (INSN_UID (next)), -1);
}
}
if (dead)
{
rtx reg = gen_rtx_REG (SImode, exact_log2 (dead & -dead));
/* It would be nice if we could convert the jump into an indirect
1997-12-07 01:31:01 +01:00
jump / far branch right now, and thus exposing all constituent
instructions to further optimization. However, reorg uses
simplejump_p to determine if there is an unconditional jump where
it should try to schedule instructions from the target of the
branch; simplejump_p fails for indirect jumps even if they have
a JUMP_LABEL. */
rtx insn = emit_insn_before (gen_indirect_jump_scratch
(reg, GEN_INT (unspec_bbr_uid++)),
jump);
/* ??? We would like this to have the scope of the jump, but that
scope will change when a delay slot insn of an inner scope is added.
Hence, after delay slot scheduling, we'll have to expect
NOTE_INSN_BLOCK_END notes between the indirect_jump_scratch and
the jump. */
INSN_LOCATION (insn) = INSN_LOCATION (jump);
INSN_CODE (insn) = CODE_FOR_indirect_jump_scratch;
return insn;
}
else if (need_block)
/* We can't use JUMP_LABEL here because it might be undefined
when not optimizing. */
return emit_insn_before (gen_block_branch_redirect
(GEN_INT (unspec_bbr_uid++)),
jump);
return prev;
}
#define CONDJUMP_MIN -252
#define CONDJUMP_MAX 262
struct far_branch
{
/* A label (to be placed) in front of the jump
that jumps to our ultimate destination. */
rtx near_label;
/* Where we are going to insert it if we cannot move the jump any farther,
or the jump itself if we have picked up an existing jump. */
rtx insert_place;
/* The ultimate destination. */
rtx far_label;
struct far_branch *prev;
/* If the branch has already been created, its address;
else the address of its first prospective user. */
int address;
};
static void gen_far_branch (struct far_branch *);
enum mdep_reorg_phase_e mdep_reorg_phase;
static void
gen_far_branch (struct far_branch *bp)
{
rtx insn = bp->insert_place;
rtx jump;
rtx label = gen_label_rtx ();
int ok;
emit_label_after (label, insn);
if (bp->far_label)
{
jump = emit_jump_insn_after (gen_jump (bp->far_label), insn);
LABEL_NUSES (bp->far_label)++;
}
else
jump = emit_jump_insn_after (gen_return (), insn);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
/* Emit a barrier so that reorg knows that any following instructions
are not reachable via a fall-through path.
But don't do this when not optimizing, since we wouldn't suppress the
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
alignment for the barrier then, and could end up with out-of-range
pc-relative loads. */
if (optimize)
emit_barrier_after (jump);
emit_label_after (bp->near_label, insn);
if (bp->far_label)
JUMP_LABEL (jump) = bp->far_label;
else
{
rtx pat = PATTERN (jump);
gcc_assert (ANY_RETURN_P (pat));
JUMP_LABEL (jump) = pat;
}
ok = invert_jump (insn, label, 1);
gcc_assert (ok);
/* If we are branching around a jump (rather than a return), prevent
reorg from using an insn from the jump target as the delay slot insn -
when reorg did this, it pessimized code (we rather hide the delay slot)
and it could cause branches to go out of range. */
if (bp->far_label)
(emit_insn_after
(gen_stuff_delay_slot
(GEN_INT (unspec_bbr_uid++),
GEN_INT (recog_memoized (insn) == CODE_FOR_branch_false)),
insn));
/* Prevent reorg from undoing our splits. */
gen_block_redirect (jump, bp->address += 2, 2);
}
/* Fix up ADDR_DIFF_VECs. */
void
fixup_addr_diff_vecs (rtx first)
{
rtx insn;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
for (insn = first; insn; insn = NEXT_INSN (insn))
{
rtx vec_lab, pat, prev, prevpat, x, braf_label;
if (!JUMP_P (insn)
|| GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
continue;
pat = PATTERN (insn);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
vec_lab = XEXP (XEXP (pat, 0), 0);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* Search the matching casesi_jump_2. */
for (prev = vec_lab; ; prev = PREV_INSN (prev))
{
if (!JUMP_P (prev))
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
continue;
prevpat = PATTERN (prev);
if (GET_CODE (prevpat) != PARALLEL || XVECLEN (prevpat, 0) != 2)
continue;
x = XVECEXP (prevpat, 0, 1);
if (GET_CODE (x) != USE)
continue;
x = XEXP (x, 0);
if (GET_CODE (x) == LABEL_REF && XEXP (x, 0) == vec_lab)
break;
}
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
/* FIXME: This is a bug in the optimizer, but it seems harmless
to just avoid panicing. */
if (!prev)
continue;
/* Emit the reference label of the braf where it belongs, right after
the casesi_jump_2 (i.e. braf). */
braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0);
emit_label_after (braf_label, prev);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* Fix up the ADDR_DIF_VEC to be relative
to the reference address of the braf. */
XEXP (XEXP (pat, 0), 0) = braf_label;
}
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* BARRIER_OR_LABEL is either a BARRIER or a CODE_LABEL immediately following
a barrier. Return the base 2 logarithm of the desired alignment. */
int
barrier_align (rtx barrier_or_label)
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
rtx next = next_real_insn (barrier_or_label), pat, prev;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (! next)
return 0;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
pat = PATTERN (next);
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (GET_CODE (pat) == ADDR_DIFF_VEC)
return 2;
if (GET_CODE (pat) == UNSPEC_VOLATILE && XINT (pat, 1) == UNSPECV_ALIGN)
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* This is a barrier in front of a constant table. */
return 0;
prev = prev_real_insn (barrier_or_label);
if (GET_CODE (PATTERN (prev)) == ADDR_DIFF_VEC)
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
pat = PATTERN (prev);
/* If this is a very small table, we want to keep the alignment after
the table to the minimum for proper code alignment. */
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
return ((optimize_size
|| ((unsigned) XVECLEN (pat, 1) * GET_MODE_SIZE (GET_MODE (pat))
<= (unsigned) 1 << (CACHE_LOG - 2)))
? 1 << TARGET_SHMEDIA : align_jumps_log);
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
if (optimize_size)
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
return 0;
if (! TARGET_SH2 || ! optimize)
return align_jumps_log;
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
/* When fixing up pcloads, a constant table might be inserted just before
the basic block that ends with the barrier. Thus, we can't trust the
instruction lengths before that. */
if (mdep_reorg_phase > SH_FIXUP_PCLOAD)
{
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
/* Check if there is an immediately preceding branch to the insn beyond
the barrier. We must weight the cost of discarding useful information
from the current cache line when executing this branch and there is
an alignment, against that of fetching unneeded insn in front of the
branch target when there is no alignment. */
/* There are two delay_slot cases to consider. One is the simple case
where the preceding branch is to the insn beyond the barrier (simple
delay slot filling), and the other is where the preceding branch has
a delay slot that is a duplicate of the insn after the barrier
(fill_eager_delay_slots) and the branch is to the insn after the insn
after the barrier. */
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
/* PREV is presumed to be the JUMP_INSN for the barrier under
investigation. Skip to the insn before it. */
int slot, credit;
bool jump_to_next = false;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
prev = prev_real_insn (prev);
for (slot = 2, credit = (1 << (CACHE_LOG - 2)) + 2;
credit >= 0 && prev && NONJUMP_INSN_P (prev);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
prev = prev_real_insn (prev))
{
jump_to_next = false;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (GET_CODE (PATTERN (prev)) == USE
|| GET_CODE (PATTERN (prev)) == CLOBBER)
continue;
if (GET_CODE (PATTERN (prev)) == SEQUENCE)
{
prev = XVECEXP (PATTERN (prev), 0, 1);
if (INSN_UID (prev) == INSN_UID (next))
{
/* Delay slot was filled with insn at jump target. */
jump_to_next = true;
continue;
}
}
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (slot &&
get_attr_in_delay_slot (prev) == IN_DELAY_SLOT_YES)
slot = 0;
credit -= get_attr_length (prev);
}
rtlanal.c (tablejump_p): False for returns. * rtlanal.c (tablejump_p): False for returns. * reorg.c (first_active_target_insn): New static function. (find_end_label): Set JUMP_LABEL for a new returnjump. (optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, get_branch_condition, steal_delay_list_from_target, own_thread_p, fill_simple_delay_slots, follow_jumps, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Adjust to handle ret_rtx in JUMP_LABELs. * jump.c (delete_related_insns): Likewise. (jump_to_label_p): New function. (redirect_target): New static function. (redirect_exp_1): Use it. Adjust to handle ret_rtx in JUMP_LABELS. (redirect_jump_1): Assert that the new label is nonnull. (redirect_jump): Likewise. (redirect_jump_2): Check for ANY_RETURN_P rather than NULL labels. * ifcvt.c (find_if_case_1): Take care when redirecting jumps to the exit block. (dead_or_predicable): Change NEW_DEST arg to DEST_EDGE. All callers changed. Ensure that the right label is passed to redirect_jump. * function.c (emit_return_into_block, thread_prologue_and_epilogue_insns): Ensure new returnjumps have ret_rtx in their JUMP_LABEL. * print-rtl.c (print_rtx): Handle ret_rtx in a JUMP_LABEL. * emit-rtl.c (skip_consecutive_labels): Allow the caller to pass ret_rtx as label. * cfglayout.c (fixup_reorder_chain): Use force_nonfallthru_and_redirect rather than force_nonfallthru. (duplicate_insn_chain): Copy JUMP_LABELs for returns. * rtl.h (ANY_RETURN_P): New macro. (jump_to_label_p): Declare. * resource.c (find_dead_or_set_registers): Handle ret_rtx in JUMP_LABELs. (mark_target_live_regs): Likewise. * basic-block.h (force_nonfallthru_and_redirect): Declare. * cfgrtl.c (force_nonfallthru_and_redirect): No longer static. * config/alpha/alpha.c (alpha_tablejump_addr_vec, alpha_tablejump_best_label): Remove functions. * config/alpha/alpha-protos.c (alpha_tablejump_addr_vec, alpha_tablejump_best_label): Remove declarations. * config/sh/sh.c (barrier_align, split_branches): Adjust for ret_rtx in JUMP_LABELs. * config/arm/arm.c (is_jump_table): Likewise. From-SVN: r176881
2011-07-28 20:45:20 +02:00
if (prev && jump_to_label_p (prev))
{
rtx x;
2001-09-14 07:02:00 +02:00
if (jump_to_next
|| next_real_insn (JUMP_LABEL (prev)) == next
/* If relax_delay_slots() decides NEXT was redundant
with some previous instruction, it will have
redirected PREV's jump to the following insn. */
|| JUMP_LABEL (prev) == next_nonnote_insn (next)
2001-09-14 07:02:00 +02:00
/* There is no upper bound on redundant instructions
that might have been skipped, but we must not put an
alignment where none had been before. */
|| (x = (NEXT_INSN (NEXT_INSN (PREV_INSN (prev)))),
(INSN_P (x)
&& (INSN_CODE (x) == CODE_FOR_block_branch_redirect
|| INSN_CODE (x) == CODE_FOR_indirect_jump_scratch
|| INSN_CODE (x) == CODE_FOR_stuff_delay_slot))))
{
rtx pat = PATTERN (prev);
if (GET_CODE (pat) == PARALLEL)
2001-09-14 07:02:00 +02:00
pat = XVECEXP (pat, 0, 0);
if (credit - slot >= (GET_CODE (SET_SRC (pat)) == PC ? 2 : 0))
return 0;
}
2001-09-14 07:02:00 +02:00
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
}
return align_jumps_log;
}
/* If we are inside a phony loop, almost any kind of label can turn up as the
first one in the loop. Aligning a braf label causes incorrect switch
destination addresses; we can detect braf labels because they are
followed by a BARRIER.
Applying loop alignment to small constant or switch tables is a waste
of space, so we suppress this too. */
int
sh_loop_align (rtx label)
{
rtx next = label;
if (! optimize || optimize_size)
return 0;
do
next = next_nonnote_insn (next);
while (next && LABEL_P (next));
if (! next
alias.c (mark_constant_function): Use INSN_P. * alias.c (mark_constant_function): Use INSN_P. (init_alias_analysis): Likewise. * combine.c (combine_instructions): Use INSN_P. (can_combine_p): Likewise. (try_combine): Likewise. (distribute_notes): Likewise. (distribute_links): Likewise. * cse.c (cse_around_loop): Use INSN_P. (invalidate_skipped_block): Likewise. (cse_set_around_loop): Likewise. (cse_end_of_basic_block): Likewise. (delete_trivially_dead_insns): Likewise. * emit-rtl.c (unshare_all_rtl_again): Use INSN_P. (unshare_all_rtl_1): Likewise. (next_cc0_user): Likewise. (try_split make_insn_raw): Likewise. (remove_unnecessary_notes): Likewise. * final.c (shorten_branches): Use INSN_P. (leaf_renumber_regs): Likewise. (leaf_renumber_regs_insn): Likewise. * flow.c (find_label_refs): Use INSN_P. (verify_wide_reg): Likewise. (notice_stack_pointer_modification): Likewise. (count_or_remove_death_notes): Likewise. (verify_flow_info): Likewise. (clear_log_links): Likewise. * function.c (fixup_var_refs_insns): Use INSN_P. (compute_insns_for_mem): Likewise. * gcse.c (alloc_gcse_mem): Use INSN_P. (compute_sets): Likewise. (compute_hash_table): Likewise. (classic_gcse): Likewise. (cprop): Likewise. (insert_insn_end_bb): Likewise. (delete_null_pointer_checks_1): Likewise. * global.c (expand_preferences): Use INSN_P. (build_insn_chain): Likewise. * graph.c (node_data): Use INSN_P. * haifa-sched.c (priority): Use INSN_P. (rm_line_notes): Likewise. (rm_other_notes): Likewise. (find_insn_reg_weight): Likewise. (init_target_units): Likewise. (schedule_block): Likewise. (compute_block_forward_dependences): Likewise. (debug_dependencies): Likewise. (set_priorities): Likewise. * integrate.c (function_cannot_inline_p): Use INSN_P. (save_parm_insns): Likewise. (copy_insn_list): Likewise. * jump.c (mark_all_labels): Use INSN_P. (never_reached_warning): Likewise. * lcm.c (optimize_mode_switching): Use INSN_P. * local-alloc.c (validate_equiv_mem): Use INSN_P. (memref_used_between_p): Likewise. (update_equiv_regs): Likewise. (block_alloc): Likewise. (no_conflict_p): Likewise. * loop.c (scan_loop): Use INSN_P. (find_and_verify_loops): Likewise. (count_loop_regs_set): Likewise. (loop_reg_used_before_p): Likewise. (strength_reduce): Likewise. (recombine_givs): Likewise. (check_dbra_loop): Likewise. (load_mems): Likewise. (try_copy_prop): Likewise. * print-rtl.c (print_rtx): Use INSN_P. * recog.c (find_single_use): Use INSN_P. * reg-stack.c (stack_regs_mentioned): Use INSN_P. (next_flags_user): Likewise. (swap_rtx_condition): Likewise. * regmove.c (mark_flags_life_zones): Use INSN_P. (optimize_reg_copy_1): Likewise. (optimize_reg_copy_2): Likewise. (optimize_reg_copy_3): Likewise. (reg_is_remote_constant_p): Likewise. (fixup_match_2): Likewise. (regmove_optimize): Likewise. (fixup_match_1): Likewise. * regrename.c (build_def_use): Use INSN_P. (replace_reg_in_block): Likewise. (consider_use): Likewise. * reload.c (find_equiv_reg): Use INSN_P. * reload1.c (reload): Use INSN_P. (maybe_fix_stack_asms): Likewise. (calculate_needs_all_insns): Likewise. (reload_as_needed): Likewise. (emit_output_reload_insns): Likewise. (delete_address_reloads_1): Likewise. (reload_cse_regs_1): Likewise. (reload_combine): Likewise. (reload_cse_move2add): Likewise. * reorg.c (redundant_insn): Use INSN_P. (dbr_schedule): Likewise. * resource.c (find_dead_or_set_registers): Use INSN_P. (mark_target_live_regs): Likewise. * rtlanal.c (reg_used_between_p): Use INSN_P. (reg_referenced_between_p): Likewise. (reg_set_between_p): Likewise. (reg_set_p): Likewise. (single_set): Likewise. (multiple_sets): Likewise. (find_last_value): Likewise. (reg_set_last): Likewise. (find_reg_note): Likewise. (find_regno_note): Likewise. * sibcall.c (sequence_uses_addressof): Use INSN_P. * simplify-rtx.c (cselib_process_insn): Use INSN_P. * ssa.c (find_evaluations): Use INSN_P. (rename_block): Likewise. (rename_equivalent_regs): Likewise. * unroll.c (loop_find_equiv_value): Use INSN_P. (set_dominates_use): Likewise. * varasm.c (mark_constant_pool): Use INSN_P. (mark_constants): Likewise. * config/alpha/alpha.c (alpha_does_function_need_gp): Use INSN_P. (alphaev4_next_group): Likewise. (alphaev5_next_group): Likewise. * config/c4x/c4x.c (c4x_process_after_reload): Use INSN_P. (c4x_rptb_rpts_p): Likewise. * config/mips/mips.c (mips16_optimize_gp): Use INSN_P. * config/rs6000/rs6000.c (uses_TOC): Use INSN_P. (rs6000_adjust_priority): Likewise. * config/sh/sh.c (sh_loop_align): Use INSN_P. (machine_dependent_reorg): Likewise. (split_branches): Likewise. * config/tahoe/tahoe.c (tahoe_cmp_check): Use INSN_P. From-SVN: r35494
2000-08-04 22:28:08 +02:00
|| ! INSN_P (next)
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC
|| recog_memoized (next) == CODE_FOR_consttable_2)
return 0;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return align_loops_log;
}
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
/* Do a final pass over the function, just before delayed branch
scheduling. */
1993-06-29 02:10:35 +02:00
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
sh_reorg (void)
{
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
rtx first, insn, mova = NULL_RTX;
int num_mova;
rtx r0_rtx = gen_rtx_REG (Pmode, 0);
rtx r0_inc_rtx = gen_rtx_POST_INC (Pmode, r0_rtx);
1995-04-21 03:19:27 +02:00
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
first = get_insns ();
max_labelno_before_reorg = max_label_num ();
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
/* We must split call insns before introducing `mova's. If we're
optimizing, they'll have already been split. Otherwise, make
sure we don't split them too late. */
if (! optimize)
split_all_insns_noflow ();
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHMEDIA)
return;
/* If relaxing, generate pseudo-ops to associate function calls with
the symbols they call. It does no harm to not generate these
pseudo-ops. However, when we can generate them, it enables the
linker to potentially relax the jsr to a bsr, and eliminate the
register load and, possibly, the constant pool entry. */
mdep_reorg_phase = SH_INSERT_USES_LABELS;
if (TARGET_RELAX)
{
Divide REG_LABEL notes into REG_LABEL_OPERAND and REG_LABEL_TARGET. * doc/rtl.texi (Insns): Specify when a label_ref makes a jump_insn. Similar for what label_refs can go in the JUMP_TARGET field. Split REG_LABEL documentation into REG_LABEL_TARGET and REG_LABEL_OPERAND. * reload.c (find_reloads): Generate REG_LABEL_OPERAND, not REG_LABEL when replacing an operand with a LABEL_REF for a non-jump insn. (subst_reloads): When replacing a LABEL_REG with a register, instead of generating a REG_LABEL note, assert that there already is one or that the label is a known target for the insn. * rtlanal.c (computed_jump_p): Instead of looking for a REG_LABEL note, check the JUMP_LABEL field. Remove "else" after return. * reorg.c (emit_delay_sequence): Replace case for REG_LABEL with cases for REG_LABEL_OPERAND and REG_LABEL_TARGET. (fill_slots_from_thread): Handle both REG_LABEL_OPERAND and REG_LABEL_TARGET notes, including the JUMP_TARGET field on JUMP_P insns. Iterate over all notes; don't assume there's only one. * cse.c (recorded_label_ref): Adjust comment to refer to REG_LABEL_OPERAND. (cse_extended_basic_block): Do LABEL_REF check for all INSN_P insns, not just NONJUMP_INSN_P. (check_for_label_ref): For JUMP_P insns, check that the LABEL_REF isn't a jump target. * jump.c (rebuild_jump_labels): Adjust head comment. (init_label_info): Ditto. Remove REG_LABEL_OPERAND notes only; don't reset REG_LABEL_TARGET notes, including the JUMP_LABEL field. (mark_all_labels): For JUMP_P insns without a target, check if the the target is noted on the previous nonjump insn. (mark_jump_label_1): New function, guts from mark_jump_label. <case IF_THEN_ELSE>: Handle first operand as a non-target when marking jump target labels. <case LABEL_REF>: Adjust for whether to generate a REG_LABEL_TARGET or a REG_LABEL_OPERAND note. For 'E' format rtl, iterate in descending element order. (delete_related_insns): Handle both REG_LABEL_TARGET and REG_LABEL_OPERAND notes. For JUMP_P insns with labels with zero reference count, delete and fallthrough. Move finding-next- non-deleted insn last in the function. Look at all INSN_P insns for REG_LABEL_OPERAND notes. (redirect_jump_2): Assert that OLABEL equals the old JUMP_LABEL of JUMP. * print-rtl.c (print_rtx): For JUMP_P insns and a non-NULL JUMP_LABEL, output the INSN_UID of it. * gcse.c: Adjust comments as appropriate to say REG_LABEL_OPERAND and/or REG_LABEL_TARGET. (add_label_notes): Only add REG_LABEL_OPERAND notes. Put in line with jump.c copy by only adding notes for labels actually referenced in the insn. * emit-rtl.c (try_split): Don't assume only NONJUMP_INSN_P need usage count increment; handle all INSN_P trial insns. (emit_copy_of_insn_after): Change to not copy REG_LABEL_OPERAND notes. * rtl.h (struct rtx_def) <volatil>: Adjust to mention REG_LABEL_TARGET and REG_LABEL_OPERAND. (LABEL_REF_NONLOCAL_P): Allow REG_LABEL_TARGET and REG_LABEL_OPERAND. * combine.c (distribute_notes): Adjust for REG_LABEL_TARGET on JUMP_P insns and REG_LABEL_OPERAND everywhere. * sched-rgn.c (is_cfg_nonregular): Check for REG_LABEL_OPERANDS on all INSN_P insns. * reg-notes.def (LABEL_TARGET, LABEL_OPERAND): Split from LABEL. * cfgrtl.c (delete_insn): Adjust to handle REG_LABEL_TARGET and REG_LABEL_OPERAND notes. * reload1.c (calculate_needs_all_insns): Adjust comments. (set_label_offsets): Adjust to look for REG_LABEL_OPERAND notes. * config/alpha/alpha.md (split for load of an address into a four-insn sequence on Unicos/Mk): Adjust to use REG_LABEL_OPERAND. * config/sh/sh.md (sh_reorg, final_prescan_insn): Ditto. From-SVN: r128287
2007-09-09 06:41:58 +02:00
/* Remove all REG_LABEL_OPERAND notes. We want to use them for our
own purposes. This works because none of the remaining passes
need to look at them.
??? But it may break in the future. We should use a machine
dependent REG_NOTE, or some other approach entirely. */
for (insn = first; insn; insn = NEXT_INSN (insn))
{
alias.c (mark_constant_function): Use INSN_P. * alias.c (mark_constant_function): Use INSN_P. (init_alias_analysis): Likewise. * combine.c (combine_instructions): Use INSN_P. (can_combine_p): Likewise. (try_combine): Likewise. (distribute_notes): Likewise. (distribute_links): Likewise. * cse.c (cse_around_loop): Use INSN_P. (invalidate_skipped_block): Likewise. (cse_set_around_loop): Likewise. (cse_end_of_basic_block): Likewise. (delete_trivially_dead_insns): Likewise. * emit-rtl.c (unshare_all_rtl_again): Use INSN_P. (unshare_all_rtl_1): Likewise. (next_cc0_user): Likewise. (try_split make_insn_raw): Likewise. (remove_unnecessary_notes): Likewise. * final.c (shorten_branches): Use INSN_P. (leaf_renumber_regs): Likewise. (leaf_renumber_regs_insn): Likewise. * flow.c (find_label_refs): Use INSN_P. (verify_wide_reg): Likewise. (notice_stack_pointer_modification): Likewise. (count_or_remove_death_notes): Likewise. (verify_flow_info): Likewise. (clear_log_links): Likewise. * function.c (fixup_var_refs_insns): Use INSN_P. (compute_insns_for_mem): Likewise. * gcse.c (alloc_gcse_mem): Use INSN_P. (compute_sets): Likewise. (compute_hash_table): Likewise. (classic_gcse): Likewise. (cprop): Likewise. (insert_insn_end_bb): Likewise. (delete_null_pointer_checks_1): Likewise. * global.c (expand_preferences): Use INSN_P. (build_insn_chain): Likewise. * graph.c (node_data): Use INSN_P. * haifa-sched.c (priority): Use INSN_P. (rm_line_notes): Likewise. (rm_other_notes): Likewise. (find_insn_reg_weight): Likewise. (init_target_units): Likewise. (schedule_block): Likewise. (compute_block_forward_dependences): Likewise. (debug_dependencies): Likewise. (set_priorities): Likewise. * integrate.c (function_cannot_inline_p): Use INSN_P. (save_parm_insns): Likewise. (copy_insn_list): Likewise. * jump.c (mark_all_labels): Use INSN_P. (never_reached_warning): Likewise. * lcm.c (optimize_mode_switching): Use INSN_P. * local-alloc.c (validate_equiv_mem): Use INSN_P. (memref_used_between_p): Likewise. (update_equiv_regs): Likewise. (block_alloc): Likewise. (no_conflict_p): Likewise. * loop.c (scan_loop): Use INSN_P. (find_and_verify_loops): Likewise. (count_loop_regs_set): Likewise. (loop_reg_used_before_p): Likewise. (strength_reduce): Likewise. (recombine_givs): Likewise. (check_dbra_loop): Likewise. (load_mems): Likewise. (try_copy_prop): Likewise. * print-rtl.c (print_rtx): Use INSN_P. * recog.c (find_single_use): Use INSN_P. * reg-stack.c (stack_regs_mentioned): Use INSN_P. (next_flags_user): Likewise. (swap_rtx_condition): Likewise. * regmove.c (mark_flags_life_zones): Use INSN_P. (optimize_reg_copy_1): Likewise. (optimize_reg_copy_2): Likewise. (optimize_reg_copy_3): Likewise. (reg_is_remote_constant_p): Likewise. (fixup_match_2): Likewise. (regmove_optimize): Likewise. (fixup_match_1): Likewise. * regrename.c (build_def_use): Use INSN_P. (replace_reg_in_block): Likewise. (consider_use): Likewise. * reload.c (find_equiv_reg): Use INSN_P. * reload1.c (reload): Use INSN_P. (maybe_fix_stack_asms): Likewise. (calculate_needs_all_insns): Likewise. (reload_as_needed): Likewise. (emit_output_reload_insns): Likewise. (delete_address_reloads_1): Likewise. (reload_cse_regs_1): Likewise. (reload_combine): Likewise. (reload_cse_move2add): Likewise. * reorg.c (redundant_insn): Use INSN_P. (dbr_schedule): Likewise. * resource.c (find_dead_or_set_registers): Use INSN_P. (mark_target_live_regs): Likewise. * rtlanal.c (reg_used_between_p): Use INSN_P. (reg_referenced_between_p): Likewise. (reg_set_between_p): Likewise. (reg_set_p): Likewise. (single_set): Likewise. (multiple_sets): Likewise. (find_last_value): Likewise. (reg_set_last): Likewise. (find_reg_note): Likewise. (find_regno_note): Likewise. * sibcall.c (sequence_uses_addressof): Use INSN_P. * simplify-rtx.c (cselib_process_insn): Use INSN_P. * ssa.c (find_evaluations): Use INSN_P. (rename_block): Likewise. (rename_equivalent_regs): Likewise. * unroll.c (loop_find_equiv_value): Use INSN_P. (set_dominates_use): Likewise. * varasm.c (mark_constant_pool): Use INSN_P. (mark_constants): Likewise. * config/alpha/alpha.c (alpha_does_function_need_gp): Use INSN_P. (alphaev4_next_group): Likewise. (alphaev5_next_group): Likewise. * config/c4x/c4x.c (c4x_process_after_reload): Use INSN_P. (c4x_rptb_rpts_p): Likewise. * config/mips/mips.c (mips16_optimize_gp): Use INSN_P. * config/rs6000/rs6000.c (uses_TOC): Use INSN_P. (rs6000_adjust_priority): Likewise. * config/sh/sh.c (sh_loop_align): Use INSN_P. (machine_dependent_reorg): Likewise. (split_branches): Likewise. * config/tahoe/tahoe.c (tahoe_cmp_check): Use INSN_P. From-SVN: r35494
2000-08-04 22:28:08 +02:00
if (INSN_P (insn))
{
rtx note;
Divide REG_LABEL notes into REG_LABEL_OPERAND and REG_LABEL_TARGET. * doc/rtl.texi (Insns): Specify when a label_ref makes a jump_insn. Similar for what label_refs can go in the JUMP_TARGET field. Split REG_LABEL documentation into REG_LABEL_TARGET and REG_LABEL_OPERAND. * reload.c (find_reloads): Generate REG_LABEL_OPERAND, not REG_LABEL when replacing an operand with a LABEL_REF for a non-jump insn. (subst_reloads): When replacing a LABEL_REG with a register, instead of generating a REG_LABEL note, assert that there already is one or that the label is a known target for the insn. * rtlanal.c (computed_jump_p): Instead of looking for a REG_LABEL note, check the JUMP_LABEL field. Remove "else" after return. * reorg.c (emit_delay_sequence): Replace case for REG_LABEL with cases for REG_LABEL_OPERAND and REG_LABEL_TARGET. (fill_slots_from_thread): Handle both REG_LABEL_OPERAND and REG_LABEL_TARGET notes, including the JUMP_TARGET field on JUMP_P insns. Iterate over all notes; don't assume there's only one. * cse.c (recorded_label_ref): Adjust comment to refer to REG_LABEL_OPERAND. (cse_extended_basic_block): Do LABEL_REF check for all INSN_P insns, not just NONJUMP_INSN_P. (check_for_label_ref): For JUMP_P insns, check that the LABEL_REF isn't a jump target. * jump.c (rebuild_jump_labels): Adjust head comment. (init_label_info): Ditto. Remove REG_LABEL_OPERAND notes only; don't reset REG_LABEL_TARGET notes, including the JUMP_LABEL field. (mark_all_labels): For JUMP_P insns without a target, check if the the target is noted on the previous nonjump insn. (mark_jump_label_1): New function, guts from mark_jump_label. <case IF_THEN_ELSE>: Handle first operand as a non-target when marking jump target labels. <case LABEL_REF>: Adjust for whether to generate a REG_LABEL_TARGET or a REG_LABEL_OPERAND note. For 'E' format rtl, iterate in descending element order. (delete_related_insns): Handle both REG_LABEL_TARGET and REG_LABEL_OPERAND notes. For JUMP_P insns with labels with zero reference count, delete and fallthrough. Move finding-next- non-deleted insn last in the function. Look at all INSN_P insns for REG_LABEL_OPERAND notes. (redirect_jump_2): Assert that OLABEL equals the old JUMP_LABEL of JUMP. * print-rtl.c (print_rtx): For JUMP_P insns and a non-NULL JUMP_LABEL, output the INSN_UID of it. * gcse.c: Adjust comments as appropriate to say REG_LABEL_OPERAND and/or REG_LABEL_TARGET. (add_label_notes): Only add REG_LABEL_OPERAND notes. Put in line with jump.c copy by only adding notes for labels actually referenced in the insn. * emit-rtl.c (try_split): Don't assume only NONJUMP_INSN_P need usage count increment; handle all INSN_P trial insns. (emit_copy_of_insn_after): Change to not copy REG_LABEL_OPERAND notes. * rtl.h (struct rtx_def) <volatil>: Adjust to mention REG_LABEL_TARGET and REG_LABEL_OPERAND. (LABEL_REF_NONLOCAL_P): Allow REG_LABEL_TARGET and REG_LABEL_OPERAND. * combine.c (distribute_notes): Adjust for REG_LABEL_TARGET on JUMP_P insns and REG_LABEL_OPERAND everywhere. * sched-rgn.c (is_cfg_nonregular): Check for REG_LABEL_OPERANDS on all INSN_P insns. * reg-notes.def (LABEL_TARGET, LABEL_OPERAND): Split from LABEL. * cfgrtl.c (delete_insn): Adjust to handle REG_LABEL_TARGET and REG_LABEL_OPERAND notes. * reload1.c (calculate_needs_all_insns): Adjust comments. (set_label_offsets): Adjust to look for REG_LABEL_OPERAND notes. * config/alpha/alpha.md (split for load of an address into a four-insn sequence on Unicos/Mk): Adjust to use REG_LABEL_OPERAND. * config/sh/sh.md (sh_reorg, final_prescan_insn): Ditto. From-SVN: r128287
2007-09-09 06:41:58 +02:00
while ((note = find_reg_note (insn, REG_LABEL_OPERAND,
NULL_RTX)) != 0)
remove_note (insn, note);
}
}
for (insn = first; insn; insn = NEXT_INSN (insn))
{
rtx pattern, reg, link, set, scan, dies, label;
int rescan = 0, foundinsn = 0;
if (CALL_P (insn))
{
pattern = PATTERN (insn);
if (GET_CODE (pattern) == PARALLEL)
pattern = XVECEXP (pattern, 0, 0);
if (GET_CODE (pattern) == SET)
pattern = SET_SRC (pattern);
if (GET_CODE (pattern) != CALL
|| !MEM_P (XEXP (pattern, 0)))
continue;
reg = XEXP (XEXP (pattern, 0), 0);
}
else
{
reg = sfunc_uses_reg (insn);
if (! reg)
continue;
}
if (!REG_P (reg))
continue;
/* Try scanning backward to find where the register is set. */
link = NULL;
for (scan = PREV_INSN (insn);
scan && !LABEL_P (scan);
scan = PREV_INSN (scan))
{
if (! INSN_P (scan))
continue;
if (! reg_mentioned_p (reg, scan))
continue;
if (noncall_uses_reg (reg, scan, &set))
break;
if (set)
{
link = scan;
break;
}
}
if (! link)
continue;
/* The register is set at LINK. */
/* We can only optimize the function call if the register is
being set to a symbol. In theory, we could sometimes
optimize calls to a constant location, but the assembler
and linker do not support that at present. */
if (GET_CODE (SET_SRC (set)) != SYMBOL_REF
&& GET_CODE (SET_SRC (set)) != LABEL_REF)
continue;
/* Scan forward from LINK to the place where REG dies, and
make sure that the only insns which use REG are
themselves function calls. */
/* ??? This doesn't work for call targets that were allocated
by reload, since there may not be a REG_DEAD note for the
register. */
dies = NULL_RTX;
for (scan = NEXT_INSN (link); scan; scan = NEXT_INSN (scan))
{
rtx scanset;
/* Don't try to trace forward past a CODE_LABEL if we haven't
seen INSN yet. Ordinarily, we will only find the setting insn
if it is in the same basic block. However,
cross-jumping can insert code labels in between the load and
the call, and can result in situations where a single call
insn may have two targets depending on where we came from. */
if (LABEL_P (scan) && ! foundinsn)
break;
alias.c (mark_constant_function): Use INSN_P. * alias.c (mark_constant_function): Use INSN_P. (init_alias_analysis): Likewise. * combine.c (combine_instructions): Use INSN_P. (can_combine_p): Likewise. (try_combine): Likewise. (distribute_notes): Likewise. (distribute_links): Likewise. * cse.c (cse_around_loop): Use INSN_P. (invalidate_skipped_block): Likewise. (cse_set_around_loop): Likewise. (cse_end_of_basic_block): Likewise. (delete_trivially_dead_insns): Likewise. * emit-rtl.c (unshare_all_rtl_again): Use INSN_P. (unshare_all_rtl_1): Likewise. (next_cc0_user): Likewise. (try_split make_insn_raw): Likewise. (remove_unnecessary_notes): Likewise. * final.c (shorten_branches): Use INSN_P. (leaf_renumber_regs): Likewise. (leaf_renumber_regs_insn): Likewise. * flow.c (find_label_refs): Use INSN_P. (verify_wide_reg): Likewise. (notice_stack_pointer_modification): Likewise. (count_or_remove_death_notes): Likewise. (verify_flow_info): Likewise. (clear_log_links): Likewise. * function.c (fixup_var_refs_insns): Use INSN_P. (compute_insns_for_mem): Likewise. * gcse.c (alloc_gcse_mem): Use INSN_P. (compute_sets): Likewise. (compute_hash_table): Likewise. (classic_gcse): Likewise. (cprop): Likewise. (insert_insn_end_bb): Likewise. (delete_null_pointer_checks_1): Likewise. * global.c (expand_preferences): Use INSN_P. (build_insn_chain): Likewise. * graph.c (node_data): Use INSN_P. * haifa-sched.c (priority): Use INSN_P. (rm_line_notes): Likewise. (rm_other_notes): Likewise. (find_insn_reg_weight): Likewise. (init_target_units): Likewise. (schedule_block): Likewise. (compute_block_forward_dependences): Likewise. (debug_dependencies): Likewise. (set_priorities): Likewise. * integrate.c (function_cannot_inline_p): Use INSN_P. (save_parm_insns): Likewise. (copy_insn_list): Likewise. * jump.c (mark_all_labels): Use INSN_P. (never_reached_warning): Likewise. * lcm.c (optimize_mode_switching): Use INSN_P. * local-alloc.c (validate_equiv_mem): Use INSN_P. (memref_used_between_p): Likewise. (update_equiv_regs): Likewise. (block_alloc): Likewise. (no_conflict_p): Likewise. * loop.c (scan_loop): Use INSN_P. (find_and_verify_loops): Likewise. (count_loop_regs_set): Likewise. (loop_reg_used_before_p): Likewise. (strength_reduce): Likewise. (recombine_givs): Likewise. (check_dbra_loop): Likewise. (load_mems): Likewise. (try_copy_prop): Likewise. * print-rtl.c (print_rtx): Use INSN_P. * recog.c (find_single_use): Use INSN_P. * reg-stack.c (stack_regs_mentioned): Use INSN_P. (next_flags_user): Likewise. (swap_rtx_condition): Likewise. * regmove.c (mark_flags_life_zones): Use INSN_P. (optimize_reg_copy_1): Likewise. (optimize_reg_copy_2): Likewise. (optimize_reg_copy_3): Likewise. (reg_is_remote_constant_p): Likewise. (fixup_match_2): Likewise. (regmove_optimize): Likewise. (fixup_match_1): Likewise. * regrename.c (build_def_use): Use INSN_P. (replace_reg_in_block): Likewise. (consider_use): Likewise. * reload.c (find_equiv_reg): Use INSN_P. * reload1.c (reload): Use INSN_P. (maybe_fix_stack_asms): Likewise. (calculate_needs_all_insns): Likewise. (reload_as_needed): Likewise. (emit_output_reload_insns): Likewise. (delete_address_reloads_1): Likewise. (reload_cse_regs_1): Likewise. (reload_combine): Likewise. (reload_cse_move2add): Likewise. * reorg.c (redundant_insn): Use INSN_P. (dbr_schedule): Likewise. * resource.c (find_dead_or_set_registers): Use INSN_P. (mark_target_live_regs): Likewise. * rtlanal.c (reg_used_between_p): Use INSN_P. (reg_referenced_between_p): Likewise. (reg_set_between_p): Likewise. (reg_set_p): Likewise. (single_set): Likewise. (multiple_sets): Likewise. (find_last_value): Likewise. (reg_set_last): Likewise. (find_reg_note): Likewise. (find_regno_note): Likewise. * sibcall.c (sequence_uses_addressof): Use INSN_P. * simplify-rtx.c (cselib_process_insn): Use INSN_P. * ssa.c (find_evaluations): Use INSN_P. (rename_block): Likewise. (rename_equivalent_regs): Likewise. * unroll.c (loop_find_equiv_value): Use INSN_P. (set_dominates_use): Likewise. * varasm.c (mark_constant_pool): Use INSN_P. (mark_constants): Likewise. * config/alpha/alpha.c (alpha_does_function_need_gp): Use INSN_P. (alphaev4_next_group): Likewise. (alphaev5_next_group): Likewise. * config/c4x/c4x.c (c4x_process_after_reload): Use INSN_P. (c4x_rptb_rpts_p): Likewise. * config/mips/mips.c (mips16_optimize_gp): Use INSN_P. * config/rs6000/rs6000.c (uses_TOC): Use INSN_P. (rs6000_adjust_priority): Likewise. * config/sh/sh.c (sh_loop_align): Use INSN_P. (machine_dependent_reorg): Likewise. (split_branches): Likewise. * config/tahoe/tahoe.c (tahoe_cmp_check): Use INSN_P. From-SVN: r35494
2000-08-04 22:28:08 +02:00
if (! INSN_P (scan))
continue;
/* Don't try to trace forward past a JUMP. To optimize
safely, we would have to check that all the
instructions at the jump destination did not use REG. */
if (JUMP_P (scan))
break;
if (! reg_mentioned_p (reg, scan))
continue;
if (noncall_uses_reg (reg, scan, &scanset))
break;
if (scan == insn)
foundinsn = 1;
if (scan != insn
&& (CALL_P (scan) || sfunc_uses_reg (scan)))
{
/* There is a function call to this register other
than the one we are checking. If we optimize
this call, we need to rescan again below. */
rescan = 1;
}
/* ??? We shouldn't have to worry about SCANSET here.
We should just be able to check for a REG_DEAD note
on a function call. However, the REG_DEAD notes are
apparently not dependable around libcalls; c-torture
execute/920501-2 is a test case. If SCANSET is set,
then this insn sets the register, so it must have
died earlier. Unfortunately, this will only handle
the cases in which the register is, in fact, set in a
later insn. */
/* ??? We shouldn't have to use FOUNDINSN here.
This dates back to when we used LOG_LINKS to find
the most recent insn which sets the register. */
if (foundinsn
&& (scanset
|| find_reg_note (scan, REG_DEAD, reg)))
{
dies = scan;
break;
}
}
if (! dies)
{
/* Either there was a branch, or some insn used REG
other than as a function call address. */
continue;
}
Divide REG_LABEL notes into REG_LABEL_OPERAND and REG_LABEL_TARGET. * doc/rtl.texi (Insns): Specify when a label_ref makes a jump_insn. Similar for what label_refs can go in the JUMP_TARGET field. Split REG_LABEL documentation into REG_LABEL_TARGET and REG_LABEL_OPERAND. * reload.c (find_reloads): Generate REG_LABEL_OPERAND, not REG_LABEL when replacing an operand with a LABEL_REF for a non-jump insn. (subst_reloads): When replacing a LABEL_REG with a register, instead of generating a REG_LABEL note, assert that there already is one or that the label is a known target for the insn. * rtlanal.c (computed_jump_p): Instead of looking for a REG_LABEL note, check the JUMP_LABEL field. Remove "else" after return. * reorg.c (emit_delay_sequence): Replace case for REG_LABEL with cases for REG_LABEL_OPERAND and REG_LABEL_TARGET. (fill_slots_from_thread): Handle both REG_LABEL_OPERAND and REG_LABEL_TARGET notes, including the JUMP_TARGET field on JUMP_P insns. Iterate over all notes; don't assume there's only one. * cse.c (recorded_label_ref): Adjust comment to refer to REG_LABEL_OPERAND. (cse_extended_basic_block): Do LABEL_REF check for all INSN_P insns, not just NONJUMP_INSN_P. (check_for_label_ref): For JUMP_P insns, check that the LABEL_REF isn't a jump target. * jump.c (rebuild_jump_labels): Adjust head comment. (init_label_info): Ditto. Remove REG_LABEL_OPERAND notes only; don't reset REG_LABEL_TARGET notes, including the JUMP_LABEL field. (mark_all_labels): For JUMP_P insns without a target, check if the the target is noted on the previous nonjump insn. (mark_jump_label_1): New function, guts from mark_jump_label. <case IF_THEN_ELSE>: Handle first operand as a non-target when marking jump target labels. <case LABEL_REF>: Adjust for whether to generate a REG_LABEL_TARGET or a REG_LABEL_OPERAND note. For 'E' format rtl, iterate in descending element order. (delete_related_insns): Handle both REG_LABEL_TARGET and REG_LABEL_OPERAND notes. For JUMP_P insns with labels with zero reference count, delete and fallthrough. Move finding-next- non-deleted insn last in the function. Look at all INSN_P insns for REG_LABEL_OPERAND notes. (redirect_jump_2): Assert that OLABEL equals the old JUMP_LABEL of JUMP. * print-rtl.c (print_rtx): For JUMP_P insns and a non-NULL JUMP_LABEL, output the INSN_UID of it. * gcse.c: Adjust comments as appropriate to say REG_LABEL_OPERAND and/or REG_LABEL_TARGET. (add_label_notes): Only add REG_LABEL_OPERAND notes. Put in line with jump.c copy by only adding notes for labels actually referenced in the insn. * emit-rtl.c (try_split): Don't assume only NONJUMP_INSN_P need usage count increment; handle all INSN_P trial insns. (emit_copy_of_insn_after): Change to not copy REG_LABEL_OPERAND notes. * rtl.h (struct rtx_def) <volatil>: Adjust to mention REG_LABEL_TARGET and REG_LABEL_OPERAND. (LABEL_REF_NONLOCAL_P): Allow REG_LABEL_TARGET and REG_LABEL_OPERAND. * combine.c (distribute_notes): Adjust for REG_LABEL_TARGET on JUMP_P insns and REG_LABEL_OPERAND everywhere. * sched-rgn.c (is_cfg_nonregular): Check for REG_LABEL_OPERANDS on all INSN_P insns. * reg-notes.def (LABEL_TARGET, LABEL_OPERAND): Split from LABEL. * cfgrtl.c (delete_insn): Adjust to handle REG_LABEL_TARGET and REG_LABEL_OPERAND notes. * reload1.c (calculate_needs_all_insns): Adjust comments. (set_label_offsets): Adjust to look for REG_LABEL_OPERAND notes. * config/alpha/alpha.md (split for load of an address into a four-insn sequence on Unicos/Mk): Adjust to use REG_LABEL_OPERAND. * config/sh/sh.md (sh_reorg, final_prescan_insn): Ditto. From-SVN: r128287
2007-09-09 06:41:58 +02:00
/* Create a code label, and put it in a REG_LABEL_OPERAND note
on the insn which sets the register, and on each call insn
which uses the register. In final_prescan_insn we look for
the REG_LABEL_OPERAND notes, and output the appropriate label
or pseudo-op. */
label = gen_label_rtx ();
rtlanal.c (add_reg_note): New function. * rtlanal.c (add_reg_note): New function. * rtl.h (add_reg_note): Declare. * auto-inc-dec.c (attempt_change): Use add_reg_note. * bb-reorder.c (add_reg_crossing_jump_notes): Likewise. * builtins.c (expand_builtin_longjmp): Likewise. (expand_builtin_nonlocal_goto): Likewise. * calls.c (emit_call_1, expand_call): Likewise. * cfgexpand.c (add_reg_br_prob_note): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. * cfgrtl.c (force_nonfallthru_and_redirect): Likewise. (commit_one_edge_insertion): Likewise. * combine.c (move_deaths, distribute_notes): Likewise. * df-problems.c (df_set_note): Likewise. * emit-rtl.c (link_cc0_insns, try_split): Likewise. (set_unique_reg_note): Likewise. (emit_copy_of_insn_after): Likewise. * expr.c (expand_expr_real): Likewise. * gcse.c (add_label_notes): Likewise. * haifa-sched.c (create_check_block_twin): Likewise. * jump.c (mark_jump_label_1): Likewise. * loop-doloop.c (add_test, doloop_modify): Likewise. * loop-unswitch.c (compare_and_jump_seq): Likewise. * lower-subreg.c (move_eh_region_note): Likewise. * optabs.c (emit_libcall_block): Likewise. * predict.c (predict_insn): Likewise. (combine_predictions_for_insn): Likewise. * recog.c (peephole2_optimize): Likewise. * regmove.c (try_auto_increment): Likewise. * reg-stack.c (emit_pop_insn, move_for_stack_reg): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (fixup_eh_region_note): Likewise. (reload_as_needed, add_auto_inc_notes, copy_eh_notes): Likewise. * reorg.c (delete_prior_computation): Likewise. (delete_computation, dbr_schedule): Likewise. * config/pa/pa.c (legitimize_pic_address): Likewise. * config/sh/sh.c (sh_reorg): Likewise. From-SVN: r137374
2008-07-02 20:01:18 +02:00
add_reg_note (link, REG_LABEL_OPERAND, label);
add_reg_note (insn, REG_LABEL_OPERAND, label);
if (rescan)
{
scan = link;
do
{
rtx reg2;
scan = NEXT_INSN (scan);
if (scan != insn
&& ((CALL_P (scan)
&& reg_mentioned_p (reg, scan))
|| ((reg2 = sfunc_uses_reg (scan))
&& REGNO (reg2) == REGNO (reg))))
rtlanal.c (add_reg_note): New function. * rtlanal.c (add_reg_note): New function. * rtl.h (add_reg_note): Declare. * auto-inc-dec.c (attempt_change): Use add_reg_note. * bb-reorder.c (add_reg_crossing_jump_notes): Likewise. * builtins.c (expand_builtin_longjmp): Likewise. (expand_builtin_nonlocal_goto): Likewise. * calls.c (emit_call_1, expand_call): Likewise. * cfgexpand.c (add_reg_br_prob_note): Likewise. * cfglayout.c (fixup_reorder_chain): Likewise. * cfgrtl.c (force_nonfallthru_and_redirect): Likewise. (commit_one_edge_insertion): Likewise. * combine.c (move_deaths, distribute_notes): Likewise. * df-problems.c (df_set_note): Likewise. * emit-rtl.c (link_cc0_insns, try_split): Likewise. (set_unique_reg_note): Likewise. (emit_copy_of_insn_after): Likewise. * expr.c (expand_expr_real): Likewise. * gcse.c (add_label_notes): Likewise. * haifa-sched.c (create_check_block_twin): Likewise. * jump.c (mark_jump_label_1): Likewise. * loop-doloop.c (add_test, doloop_modify): Likewise. * loop-unswitch.c (compare_and_jump_seq): Likewise. * lower-subreg.c (move_eh_region_note): Likewise. * optabs.c (emit_libcall_block): Likewise. * predict.c (predict_insn): Likewise. (combine_predictions_for_insn): Likewise. * recog.c (peephole2_optimize): Likewise. * regmove.c (try_auto_increment): Likewise. * reg-stack.c (emit_pop_insn, move_for_stack_reg): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (fixup_eh_region_note): Likewise. (reload_as_needed, add_auto_inc_notes, copy_eh_notes): Likewise. * reorg.c (delete_prior_computation): Likewise. (delete_computation, dbr_schedule): Likewise. * config/pa/pa.c (legitimize_pic_address): Likewise. * config/sh/sh.c (sh_reorg): Likewise. From-SVN: r137374
2008-07-02 20:01:18 +02:00
add_reg_note (scan, REG_LABEL_OPERAND, label);
}
while (scan != dies);
}
}
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (TARGET_SH2)
fixup_addr_diff_vecs (first);
if (optimize)
{
mdep_reorg_phase = SH_SHORTEN_BRANCHES0;
shorten_branches (first);
}
/* Scan the function looking for move instructions which have to be
changed to pc-relative loads and insert the literal tables. */
label_ref_list_pool = create_alloc_pool ("label references list",
sizeof (struct label_ref_list_d),
30);
mdep_reorg_phase = SH_FIXUP_PCLOAD;
for (insn = first, num_mova = 0; insn; insn = NEXT_INSN (insn))
{
if (mova_p (insn))
{
/* ??? basic block reordering can move a switch table dispatch
below the switch table. Check if that has happened.
We only have the addresses available when optimizing; but then,
this check shouldn't be needed when not optimizing. */
if (!untangle_mova (&num_mova, &mova, insn))
{
insn = mova;
num_mova = 0;
}
}
else if (JUMP_P (insn)
&& GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
&& num_mova
/* ??? loop invariant motion can also move a mova out of a
loop. Since loop does this code motion anyway, maybe we
should wrap UNSPEC_MOVA into a CONST, so that reload can
move it back. */
&& ((num_mova > 1
&& GET_MODE (prev_nonnote_insn (insn)) == VOIDmode)
|| (prev_nonnote_insn (insn)
== XEXP (MOVA_LABELREF (mova), 0))))
{
rtx scan;
int total;
num_mova--;
/* Some code might have been inserted between the mova and
its ADDR_DIFF_VEC. Check if the mova is still in range. */
for (scan = mova, total = 0; scan != insn; scan = NEXT_INSN (scan))
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
total += get_attr_length (scan);
/* range of mova is 1020, add 4 because pc counts from address of
second instruction after this one, subtract 2 in case pc is 2
byte aligned. Possible alignment needed for the ADDR_DIFF_VEC
1997-12-07 01:31:01 +01:00
cancels out with alignment effects of the mova itself. */
if (total > 1022)
{
/* Change the mova into a load, and restart scanning
there. broken_move will then return true for mova. */
fixup_mova (mova);
insn = mova;
}
}
if (broken_move (insn)
|| (NONJUMP_INSN_P (insn)
&& recog_memoized (insn) == CODE_FOR_casesi_worker_2))
{
rtx scan;
1995-04-21 03:19:27 +02:00
/* Scan ahead looking for a barrier to stick the constant table
behind. */
rtx barrier = find_barrier (num_mova, mova, insn);
rtx last_float_move = NULL_RTX, last_float = 0, *last_float_addr = NULL;
int need_aligned_label = 0;
1993-06-29 02:10:35 +02:00
if (num_mova && ! mova_p (mova))
{
/* find_barrier had to change the first mova into a
pcload; thus, we have to start with this new pcload. */
insn = mova;
num_mova = 0;
}
/* Now find all the moves between the points and modify them. */
for (scan = insn; scan != barrier; scan = NEXT_INSN (scan))
{
if (LABEL_P (scan))
last_float = 0;
if (NONJUMP_INSN_P (scan)
&& recog_memoized (scan) == CODE_FOR_casesi_worker_2)
need_aligned_label = 1;
if (broken_move (scan))
{
rtx *patp = &PATTERN (scan), pat = *patp;
rtx src, dst;
rtx lab;
rtx newsrc;
enum machine_mode mode;
if (GET_CODE (pat) == PARALLEL)
patp = &XVECEXP (pat, 0, 0), pat = *patp;
src = SET_SRC (pat);
dst = SET_DEST (pat);
mode = GET_MODE (dst);
if (mode == SImode && satisfies_constraint_I16 (src)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
&& REGNO (dst) != FPUL_REG)
{
int offset = 0;
1995-04-21 03:19:27 +02:00
mode = HImode;
while (GET_CODE (dst) == SUBREG)
{
Use byte offsets in SUBREGs instead of words. 2001-04-03 Jakub Jelinek <jakub@redhat.com> David S. Miller <davem@pierdol.cobaltmicro.com> Andrew MacLeod <amacleod@redhat.com> Use byte offsets in SUBREGs instead of words. * alias.c (nonlocal_mentioned_p): Use subreg_regno function. * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno to pass new argument. (add_stored_regs): Use subreg_regno_offset function. * calls.c (expand_call): For non-paradoxical SUBREG take endianess into account. (precompute_arguments): Use gen_lowpart_SUBREG. * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. (combine_simplify_rtx): Rework to use SUBREG_BYTE. (simplify_set): Rework to use SUBREG_BYTE. (expand_field_assignment): Use SUBREG_BYTE. (make_extraction): Use SUBREG_BYTE. (if_then_else_cond): Use SUBREG_BYTE. (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. (gen_lowpart_for_combine): Compute full byte offset. * cse.c (mention_regs): Use SUBREG_BYTE. (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. (canon_hash): Use SUBREG_BYTE. (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. (gen_lowpart_if_possible): Formatting. * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos correctly. * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (loc_descriptor): Fixup explicit XEXP into SUBREG_REG * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify certain invariants about SUBREGs the compiler creates. (gen_lowpart_SUBREG): New function. (subreg_hard_regno): New function to get the final register number. (gen_lowpart_common): Use SUBREG_BYTE. (gen_imagpart): Spacing nits. (subreg_realpart_p): Use SUBREG_BYTE. (gen_highpart): Use SUBREG_BYTE. (subreg_lowpart_p): Always compute endian corrected goal offset, even at the byte level, then compare against that. (constant_subword): New function, pulled out all constant cases from operand_subword and changed second argument name to offset. (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early and call constant_subword to do the work. Return const0_rtx if looking for a word outside of OP. (operand_subword_force): Change second arg name to offset. * expmed.c (store_bit_field): Use SUBREG_BYTE. (store_split_bit_field): Use SUBREG_BYTE. (extract_bit_field): Use SUBREG_BYTE. (extract_split_bit_field): Use SUBREG_BYTE. (expand_shift): Use SUBREG_BYTE. * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. * flow.c (set_noop_p): Use SUBREG_BYTE. (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian correction code. (optimize_bit_field): Use SUBREG_BYTE. (purge_addressof_1): Use SUBREG_BYTE. (purge_single_hard_subreg_set): Use subreg_regno_offset function. (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. * gengenrtl.c (special_rtx): Add SUBREG. * global.c (mark_reg_store): Use SUBREG_BYTE. (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure final byte offset is congruent to subreg's mode size. (subst_constants): Use SUBREG_BYTE. (mark_stores): Use subreg_regno_offset function. * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset function and SUBREG_BYTE. * local-alloc.c (combine_regs): Use subreg_regno_offset function. (reg_is_born): Use subreg_hard_regno. * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte endian correction code. Don't combine subregs unless resulting offset aligns with type. Fix subreg constant extraction for DImode. Simplify SUBREG of VOIDmode CONST_DOUBLE. (general_operand): Remove dead mode_altering_drug code. (indirect_operand): Use SUBREG_BYTE. (constrain_operands): Use subreg_regno_offset function. * reg-stack.c (get_true_reg): Use subreg_regno_offset function. * regmove.c (regmove_optimize): Use SUBREG_BYTE. (optimize_reg_copy_3): Use gen_lowpart_SUBREG. * regs.h (REG_SIZE): Allow target to override. (REGMODE_NATURAL_SIZE): New macro which target can override. * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used on the entire subreg rtx. (push_reload): Use SUBREG_BYTE in comments and code. (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets for hard registers inside subregs. (operands_match_p): Use subreg_regno_offset. (find_reloads): Use SUBREG_BYTE and only advance offset for subregs containing hard regs. (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and subreg_regno_offset where appropriate. (find_reloads_subreg_address): Use SUBREG_BYTE. Remove byte endian corrections when fixing up MEM subregs. (subst_reloads): When combining two subregs, make sure final offset is congruent to subreg's mode size. (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. (refers_to_regno_for_reload_p): Use subreg_regno. (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian correction code for memory subreg fixups. (forget_old_reload_1): Use subreg_regno_offset. (choose_reload_regs): Use subreg_regno. (emit_input_reload_insns): Use SUBREG_BYTE. (reload_combine_note_store): Use subreg_regno_offset. (move2add_note_store): Use subreg_regno_offset. * resource.c (update_live_status, mark_referenced_resources): Use subreg_regno function. (mark_set_resources): Use subreg_regno function. * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. (subreg_regno_offset, subreg_regno): Define prototypes. (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. (gen_lowpart_SUBREG): Add prototype. * rtl.texi (subreg): Update to reflect new byte offset representation. Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. * rtlanal.c (refers_to_regno_p): Use subreg_regno. (reg_overlap_mentioned_p): Use subreg_regno. (replace_regs); Make sure final offset of combined subreg is congruent to size of subreg's mode. (subreg_regno_offset): New function. (subreg_regno): New function. * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. (a29k_get_reloaded_address): Use SUBREG_BYTE. (print_operand): Use SUBREG_BYTE. * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. (arm_reload_out_hi): Use SUBREG_BYTE. * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset instead of SUBREG_WORD. (d30v_print_operand_memory_reference): Use subreg_regno_offset. * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix SUBREG creation to use byte offset. * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit inverted load insns): Fix explicit rtl subregs to use byte offsets. * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, udivsi3, umodsi3): Generate SUBREGs with byte offsets. * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl to use byte offsets. (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, unnamed ldob insn): Generate SUBREGs with byte offset. (zero_extendqihi2): SUBREG's are byte offsets. * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. (m68hc11_gen_highpart): Use SUBREG_BYTE. * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, zero-extendqisi2): Generate SUBREGs with byte offset. (umulsidi3, mulsidi3, subreghi1ashrdi_const32, subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit subregs in rtl to use byte offsets. * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. (mips_move_2words): Use subreg_regno_offset. (mips_secondary_reload_class): Use subreg_regno_offset. * config/mips/mips.md (DImode plus, minus, move, and logical op splits): Fixup explicit subregs in rtl to use byte offsets. * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in rtl to use byte offsets. * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit subregs to use byte offsets. * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): Fixup explicit subregs in rtl to use byte offsets. * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE and remove byte endian correction code. * config/sh/sh.c (output_movedouble): Use subreg_regno. (gen_ashift_hi): Use SUBREG_BYTE. (regs_used): Use subreg_regno_offset. (machine_dependent_reorg): Use subreg_regno_offset. * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. (movdf_i4): Subregs are byte offsets now. * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. (REGMODE_NATURAL_SIZE): Override. (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs with byte offsets. (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, extendqidi2): Generate SUBREGs with byte offsets, also make sure it is congruent to SUBREG's mode size. (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte offsets. (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper SUBREG_BYTE offset for non-paradoxical subregs in patterns. * config/v850/v850.c (print_operand, output_move_double): Use subreg_regno function. Co-Authored-By: Andrew MacLeod <amacleod@redhat.com> Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com> From-SVN: r41058
2001-04-03 17:06:12 +02:00
offset += subreg_regno_offset (REGNO (SUBREG_REG (dst)),
GET_MODE (SUBREG_REG (dst)),
SUBREG_BYTE (dst),
GET_MODE (dst));
dst = SUBREG_REG (dst);
}
dst = gen_rtx_REG (HImode, REGNO (dst) + offset);
}
if (REG_P (dst) && FP_ANY_REGISTER_P (REGNO (dst)))
{
/* This must be an insn that clobbers r0. */
rtx *clobberp = &XVECEXP (PATTERN (scan), 0,
XVECLEN (PATTERN (scan), 0)
- 1);
rtx clobber = *clobberp;
gcc_assert (GET_CODE (clobber) == CLOBBER
&& rtx_equal_p (XEXP (clobber, 0), r0_rtx));
if (last_float
&& reg_set_between_p (r0_rtx, last_float_move, scan))
last_float = 0;
if (last_float
&& TARGET_SHCOMPACT
&& GET_MODE_SIZE (mode) != 4
&& GET_MODE_SIZE (GET_MODE (last_float)) == 4)
last_float = 0;
lab = add_constant (src, mode, last_float);
if (lab)
emit_insn_before (gen_mova (lab), scan);
else
{
/* There will be a REG_UNUSED note for r0 on
LAST_FLOAT_MOVE; we have to change it to REG_INC,
lest reorg:mark_target_live_regs will not
consider r0 to be used, and we end up with delay
2000-02-28 22:42:55 +01:00
slot insn in front of SCAN that clobbers r0. */
rtx note
= find_regno_note (last_float_move, REG_UNUSED, 0);
/* If we are not optimizing, then there may not be
a note. */
if (note)
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
PUT_REG_NOTE_KIND (note, REG_INC);
*last_float_addr = r0_inc_rtx;
}
last_float_move = scan;
last_float = src;
newsrc = gen_const_mem (mode,
(((TARGET_SH4 && ! TARGET_FMOVD)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
|| REGNO (dst) == FPUL_REG)
? r0_inc_rtx
: r0_rtx));
last_float_addr = &XEXP (newsrc, 0);
/* Remove the clobber of r0. */
*clobberp = gen_rtx_CLOBBER (GET_MODE (clobber),
gen_rtx_SCRATCH (Pmode));
}
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
/* This is a mova needing a label. Create it. */
else if (GET_CODE (src) == UNSPEC
&& XINT (src, 1) == UNSPEC_MOVA
&& GET_CODE (XVECEXP (src, 0, 0)) == CONST)
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
{
lab = add_constant (XVECEXP (src, 0, 0), mode, 0);
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
newsrc = gen_rtx_LABEL_REF (VOIDmode, lab);
newsrc = gen_rtx_UNSPEC (SImode,
gen_rtvec (1, newsrc),
UNSPEC_MOVA);
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
}
else
{
lab = add_constant (src, mode, 0);
newsrc = gen_rtx_LABEL_REF (VOIDmode, lab);
newsrc = gen_const_mem (mode, newsrc);
}
*patp = gen_rtx_SET (VOIDmode, dst, newsrc);
INSN_CODE (scan) = -1;
}
}
dump_table (need_aligned_label ? insn : 0, barrier);
insn = barrier;
}
}
free_alloc_pool (label_ref_list_pool);
for (insn = first; insn; insn = NEXT_INSN (insn))
PUT_MODE (insn, VOIDmode);
mdep_reorg_phase = SH_SHORTEN_BRANCHES1;
INSN_ADDRESSES_FREE ();
split_branches (first);
/* The INSN_REFERENCES_ARE_DELAYED in sh.h is problematic because it
also has an effect on the register that holds the address of the sfunc.
Insert an extra dummy insn in front of each sfunc that pretends to
use this register. */
if (flag_delayed_branch)
{
for (insn = first; insn; insn = NEXT_INSN (insn))
{
rtx reg = sfunc_uses_reg (insn);
if (! reg)
continue;
emit_insn_before (gen_use_sfunc_addr (reg), insn);
}
}
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
#if 0
/* fpscr is not actually a user variable, but we pretend it is for the
sake of the previous optimization passes, since we want it handled like
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
one. However, we don't have any debugging information for it, so turn
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
it into a non-user variable now. */
if (TARGET_SH4)
REG_USERVAR_P (get_fpscr_rtx ()) = 0;
#endif
mdep_reorg_phase = SH_AFTER_MDEP_REORG;
}
int
get_dest_uid (rtx label, int max_uid)
{
rtx dest = next_real_insn (label);
int dest_uid;
if (! dest)
/* This can happen for an undefined label. */
return 0;
dest_uid = INSN_UID (dest);
/* If this is a newly created branch redirection blocking instruction,
we cannot index the branch_uid or insn_addresses arrays with its
uid. But then, we won't need to, because the actual destination is
the following branch. */
while (dest_uid >= max_uid)
{
dest = NEXT_INSN (dest);
dest_uid = INSN_UID (dest);
}
if (JUMP_P (dest) && GET_CODE (PATTERN (dest)) == RETURN)
return 0;
return dest_uid;
}
/* Split condbranches that are out of range. Also add clobbers for
scratch registers that are needed in far jumps.
We do this before delay slot scheduling, so that it can take our
newly created instructions into account. It also allows us to
find branches with common targets more easily. */
static void
split_branches (rtx first)
{
rtx insn;
struct far_branch **uid_branch, *far_branch_list = 0;
int max_uid = get_max_uid ();
int ok;
/* Find out which branches are out of range. */
shorten_branches (first);
uid_branch = (struct far_branch **) alloca (max_uid * sizeof *uid_branch);
memset ((char *) uid_branch, 0, max_uid * sizeof *uid_branch);
for (insn = first; insn; insn = NEXT_INSN (insn))
alias.c (mark_constant_function): Use INSN_P. * alias.c (mark_constant_function): Use INSN_P. (init_alias_analysis): Likewise. * combine.c (combine_instructions): Use INSN_P. (can_combine_p): Likewise. (try_combine): Likewise. (distribute_notes): Likewise. (distribute_links): Likewise. * cse.c (cse_around_loop): Use INSN_P. (invalidate_skipped_block): Likewise. (cse_set_around_loop): Likewise. (cse_end_of_basic_block): Likewise. (delete_trivially_dead_insns): Likewise. * emit-rtl.c (unshare_all_rtl_again): Use INSN_P. (unshare_all_rtl_1): Likewise. (next_cc0_user): Likewise. (try_split make_insn_raw): Likewise. (remove_unnecessary_notes): Likewise. * final.c (shorten_branches): Use INSN_P. (leaf_renumber_regs): Likewise. (leaf_renumber_regs_insn): Likewise. * flow.c (find_label_refs): Use INSN_P. (verify_wide_reg): Likewise. (notice_stack_pointer_modification): Likewise. (count_or_remove_death_notes): Likewise. (verify_flow_info): Likewise. (clear_log_links): Likewise. * function.c (fixup_var_refs_insns): Use INSN_P. (compute_insns_for_mem): Likewise. * gcse.c (alloc_gcse_mem): Use INSN_P. (compute_sets): Likewise. (compute_hash_table): Likewise. (classic_gcse): Likewise. (cprop): Likewise. (insert_insn_end_bb): Likewise. (delete_null_pointer_checks_1): Likewise. * global.c (expand_preferences): Use INSN_P. (build_insn_chain): Likewise. * graph.c (node_data): Use INSN_P. * haifa-sched.c (priority): Use INSN_P. (rm_line_notes): Likewise. (rm_other_notes): Likewise. (find_insn_reg_weight): Likewise. (init_target_units): Likewise. (schedule_block): Likewise. (compute_block_forward_dependences): Likewise. (debug_dependencies): Likewise. (set_priorities): Likewise. * integrate.c (function_cannot_inline_p): Use INSN_P. (save_parm_insns): Likewise. (copy_insn_list): Likewise. * jump.c (mark_all_labels): Use INSN_P. (never_reached_warning): Likewise. * lcm.c (optimize_mode_switching): Use INSN_P. * local-alloc.c (validate_equiv_mem): Use INSN_P. (memref_used_between_p): Likewise. (update_equiv_regs): Likewise. (block_alloc): Likewise. (no_conflict_p): Likewise. * loop.c (scan_loop): Use INSN_P. (find_and_verify_loops): Likewise. (count_loop_regs_set): Likewise. (loop_reg_used_before_p): Likewise. (strength_reduce): Likewise. (recombine_givs): Likewise. (check_dbra_loop): Likewise. (load_mems): Likewise. (try_copy_prop): Likewise. * print-rtl.c (print_rtx): Use INSN_P. * recog.c (find_single_use): Use INSN_P. * reg-stack.c (stack_regs_mentioned): Use INSN_P. (next_flags_user): Likewise. (swap_rtx_condition): Likewise. * regmove.c (mark_flags_life_zones): Use INSN_P. (optimize_reg_copy_1): Likewise. (optimize_reg_copy_2): Likewise. (optimize_reg_copy_3): Likewise. (reg_is_remote_constant_p): Likewise. (fixup_match_2): Likewise. (regmove_optimize): Likewise. (fixup_match_1): Likewise. * regrename.c (build_def_use): Use INSN_P. (replace_reg_in_block): Likewise. (consider_use): Likewise. * reload.c (find_equiv_reg): Use INSN_P. * reload1.c (reload): Use INSN_P. (maybe_fix_stack_asms): Likewise. (calculate_needs_all_insns): Likewise. (reload_as_needed): Likewise. (emit_output_reload_insns): Likewise. (delete_address_reloads_1): Likewise. (reload_cse_regs_1): Likewise. (reload_combine): Likewise. (reload_cse_move2add): Likewise. * reorg.c (redundant_insn): Use INSN_P. (dbr_schedule): Likewise. * resource.c (find_dead_or_set_registers): Use INSN_P. (mark_target_live_regs): Likewise. * rtlanal.c (reg_used_between_p): Use INSN_P. (reg_referenced_between_p): Likewise. (reg_set_between_p): Likewise. (reg_set_p): Likewise. (single_set): Likewise. (multiple_sets): Likewise. (find_last_value): Likewise. (reg_set_last): Likewise. (find_reg_note): Likewise. (find_regno_note): Likewise. * sibcall.c (sequence_uses_addressof): Use INSN_P. * simplify-rtx.c (cselib_process_insn): Use INSN_P. * ssa.c (find_evaluations): Use INSN_P. (rename_block): Likewise. (rename_equivalent_regs): Likewise. * unroll.c (loop_find_equiv_value): Use INSN_P. (set_dominates_use): Likewise. * varasm.c (mark_constant_pool): Use INSN_P. (mark_constants): Likewise. * config/alpha/alpha.c (alpha_does_function_need_gp): Use INSN_P. (alphaev4_next_group): Likewise. (alphaev5_next_group): Likewise. * config/c4x/c4x.c (c4x_process_after_reload): Use INSN_P. (c4x_rptb_rpts_p): Likewise. * config/mips/mips.c (mips16_optimize_gp): Use INSN_P. * config/rs6000/rs6000.c (uses_TOC): Use INSN_P. (rs6000_adjust_priority): Likewise. * config/sh/sh.c (sh_loop_align): Use INSN_P. (machine_dependent_reorg): Likewise. (split_branches): Likewise. * config/tahoe/tahoe.c (tahoe_cmp_check): Use INSN_P. From-SVN: r35494
2000-08-04 22:28:08 +02:00
if (! INSN_P (insn))
continue;
else if (INSN_DELETED_P (insn))
{
/* Shorten_branches would split this instruction again,
so transform it into a 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
SET_INSN_DELETED (insn);
}
else if (JUMP_P (insn)
/* Don't mess with ADDR_DIFF_VEC */
&& (GET_CODE (PATTERN (insn)) == SET
|| GET_CODE (PATTERN (insn)) == RETURN))
{
enum attr_type type = get_attr_type (insn);
if (type == TYPE_CBRANCH)
{
rtx next, beyond;
if (get_attr_length (insn) > 4)
{
rtx src = SET_SRC (PATTERN (insn));
rtx olabel = XEXP (XEXP (src, 1), 0);
int addr = INSN_ADDRESSES (INSN_UID (insn));
rtx label = 0;
int dest_uid = get_dest_uid (olabel, max_uid);
struct far_branch *bp = uid_branch[dest_uid];
/* redirect_jump needs a valid JUMP_LABEL, and it might delete
1998-03-09 13:02:59 +01:00
the label if the LABEL_NUSES count drops to zero. There is
always a jump_optimize pass that sets these values, but it
proceeds to delete unreferenced code, and then if not
1997-12-07 01:31:01 +01:00
optimizing, to un-delete the deleted instructions, thus
leaving labels with too low uses counts. */
if (! optimize)
{
JUMP_LABEL (insn) = olabel;
LABEL_NUSES (olabel)++;
}
if (! bp)
{
bp = (struct far_branch *) alloca (sizeof *bp);
uid_branch[dest_uid] = bp;
bp->prev = far_branch_list;
far_branch_list = bp;
bp->far_label
= XEXP (XEXP (SET_SRC (PATTERN (insn)), 1), 0);
LABEL_NUSES (bp->far_label)++;
}
else
{
label = bp->near_label;
if (! label && bp->address - addr >= CONDJUMP_MIN)
{
rtx block = bp->insert_place;
if (GET_CODE (PATTERN (block)) == RETURN)
block = PREV_INSN (block);
else
block = gen_block_redirect (block,
bp->address, 2);
label = emit_label_after (gen_label_rtx (),
PREV_INSN (block));
bp->near_label = label;
}
else if (label && ! NEXT_INSN (label))
{
if (addr + 2 - bp->address <= CONDJUMP_MAX)
bp->insert_place = insn;
else
gen_far_branch (bp);
}
}
if (! label
|| (NEXT_INSN (label) && bp->address - addr < CONDJUMP_MIN))
{
bp->near_label = label = gen_label_rtx ();
bp->insert_place = insn;
bp->address = addr;
}
ok = redirect_jump (insn, label, 0);
gcc_assert (ok);
}
else
{
/* get_attr_length (insn) == 2 */
/* Check if we have a pattern where reorg wants to redirect
the branch to a label from an unconditional branch that
is too far away. */
/* We can't use JUMP_LABEL here because it might be undefined
when not optimizing. */
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* A syntax error might cause beyond to be NULL_RTX. */
beyond
= next_active_insn (XEXP (XEXP (SET_SRC (PATTERN (insn)), 1),
0));
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
if (beyond
&& (JUMP_P (beyond)
|| ((beyond = next_active_insn (beyond))
&& JUMP_P (beyond)))
&& GET_CODE (PATTERN (beyond)) == SET
&& recog_memoized (beyond) == CODE_FOR_jump_compact
&& ((INSN_ADDRESSES
(INSN_UID (XEXP (SET_SRC (PATTERN (beyond)), 0)))
- INSN_ADDRESSES (INSN_UID (insn)) + (unsigned) 252)
> 252 + 258 + 2))
gen_block_redirect (beyond,
INSN_ADDRESSES (INSN_UID (beyond)), 1);
}
next = next_active_insn (insn);
if (next
&& (JUMP_P (next)
|| ((next = next_active_insn (next))
&& JUMP_P (next)))
&& GET_CODE (PATTERN (next)) == SET
&& recog_memoized (next) == CODE_FOR_jump_compact
&& ((INSN_ADDRESSES
(INSN_UID (XEXP (SET_SRC (PATTERN (next)), 0)))
- INSN_ADDRESSES (INSN_UID (insn)) + (unsigned) 252)
> 252 + 258 + 2))
gen_block_redirect (next, INSN_ADDRESSES (INSN_UID (next)), 1);
}
else if (type == TYPE_JUMP || type == TYPE_RETURN)
{
int addr = INSN_ADDRESSES (INSN_UID (insn));
rtx far_label = 0;
int dest_uid = 0;
struct far_branch *bp;
if (type == TYPE_JUMP)
{
far_label = XEXP (SET_SRC (PATTERN (insn)), 0);
dest_uid = get_dest_uid (far_label, max_uid);
if (! dest_uid)
{
/* Parse errors can lead to labels outside
the insn stream. */
if (! NEXT_INSN (far_label))
continue;
if (! optimize)
{
JUMP_LABEL (insn) = far_label;
LABEL_NUSES (far_label)++;
}
rtlanal.c (tablejump_p): False for returns. * rtlanal.c (tablejump_p): False for returns. * reorg.c (first_active_target_insn): New static function. (find_end_label): Set JUMP_LABEL for a new returnjump. (optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, get_branch_condition, steal_delay_list_from_target, own_thread_p, fill_simple_delay_slots, follow_jumps, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Adjust to handle ret_rtx in JUMP_LABELs. * jump.c (delete_related_insns): Likewise. (jump_to_label_p): New function. (redirect_target): New static function. (redirect_exp_1): Use it. Adjust to handle ret_rtx in JUMP_LABELS. (redirect_jump_1): Assert that the new label is nonnull. (redirect_jump): Likewise. (redirect_jump_2): Check for ANY_RETURN_P rather than NULL labels. * ifcvt.c (find_if_case_1): Take care when redirecting jumps to the exit block. (dead_or_predicable): Change NEW_DEST arg to DEST_EDGE. All callers changed. Ensure that the right label is passed to redirect_jump. * function.c (emit_return_into_block, thread_prologue_and_epilogue_insns): Ensure new returnjumps have ret_rtx in their JUMP_LABEL. * print-rtl.c (print_rtx): Handle ret_rtx in a JUMP_LABEL. * emit-rtl.c (skip_consecutive_labels): Allow the caller to pass ret_rtx as label. * cfglayout.c (fixup_reorder_chain): Use force_nonfallthru_and_redirect rather than force_nonfallthru. (duplicate_insn_chain): Copy JUMP_LABELs for returns. * rtl.h (ANY_RETURN_P): New macro. (jump_to_label_p): Declare. * resource.c (find_dead_or_set_registers): Handle ret_rtx in JUMP_LABELs. (mark_target_live_regs): Likewise. * basic-block.h (force_nonfallthru_and_redirect): Declare. * cfgrtl.c (force_nonfallthru_and_redirect): No longer static. * config/alpha/alpha.c (alpha_tablejump_addr_vec, alpha_tablejump_best_label): Remove functions. * config/alpha/alpha-protos.c (alpha_tablejump_addr_vec, alpha_tablejump_best_label): Remove declarations. * config/sh/sh.c (barrier_align, split_branches): Adjust for ret_rtx in JUMP_LABELs. * config/arm/arm.c (is_jump_table): Likewise. From-SVN: r176881
2011-07-28 20:45:20 +02:00
redirect_jump (insn, ret_rtx, 1);
far_label = 0;
}
}
bp = uid_branch[dest_uid];
if (! bp)
{
bp = (struct far_branch *) alloca (sizeof *bp);
uid_branch[dest_uid] = bp;
bp->prev = far_branch_list;
far_branch_list = bp;
bp->near_label = 0;
bp->far_label = far_label;
if (far_label)
LABEL_NUSES (far_label)++;
}
else if (bp->near_label && ! NEXT_INSN (bp->near_label))
if (addr - bp->address <= CONDJUMP_MAX)
emit_label_after (bp->near_label, PREV_INSN (insn));
else
{
gen_far_branch (bp);
bp->near_label = 0;
}
else
bp->near_label = 0;
bp->address = addr;
bp->insert_place = insn;
if (! far_label)
emit_insn_before (gen_block_branch_redirect (const0_rtx), insn);
else
gen_block_redirect (insn, addr, bp->near_label ? 2 : 0);
}
}
/* Generate all pending far branches,
and free our references to the far labels. */
while (far_branch_list)
{
if (far_branch_list->near_label
&& ! NEXT_INSN (far_branch_list->near_label))
gen_far_branch (far_branch_list);
if (optimize
&& far_branch_list->far_label
&& ! --LABEL_NUSES (far_branch_list->far_label))
delete_insn (far_branch_list->far_label);
far_branch_list = far_branch_list->prev;
}
/* Instruction length information is no longer valid due to the new
instructions that have been generated. */
init_insn_lengths ();
1993-06-29 02:10:35 +02:00
}
1995-04-21 03:19:27 +02:00
/* Dump out instruction addresses, which is useful for debugging the
constant pool table stuff.
If relaxing, output the label and pseudo-ops used to link together
calls and the instruction which set the registers. */
1995-04-21 03:19:27 +02:00
/* ??? The addresses printed by this routine for insns are nonsense for
insns which are inside of a sequence where none of the inner insns have
variable length. This is because the second pass of shorten_branches
does not bother to update them. */
void
final_prescan_insn (rtx insn, rtx *opvec ATTRIBUTE_UNUSED,
int noperands ATTRIBUTE_UNUSED)
1993-06-29 02:10:35 +02:00
{
1995-04-21 03:19:27 +02:00
if (TARGET_DUMPISIZE)
fprintf (asm_out_file, "\n! at %04x\n", INSN_ADDRESSES (INSN_UID (insn)));
if (TARGET_RELAX)
{
rtx note;
Divide REG_LABEL notes into REG_LABEL_OPERAND and REG_LABEL_TARGET. * doc/rtl.texi (Insns): Specify when a label_ref makes a jump_insn. Similar for what label_refs can go in the JUMP_TARGET field. Split REG_LABEL documentation into REG_LABEL_TARGET and REG_LABEL_OPERAND. * reload.c (find_reloads): Generate REG_LABEL_OPERAND, not REG_LABEL when replacing an operand with a LABEL_REF for a non-jump insn. (subst_reloads): When replacing a LABEL_REG with a register, instead of generating a REG_LABEL note, assert that there already is one or that the label is a known target for the insn. * rtlanal.c (computed_jump_p): Instead of looking for a REG_LABEL note, check the JUMP_LABEL field. Remove "else" after return. * reorg.c (emit_delay_sequence): Replace case for REG_LABEL with cases for REG_LABEL_OPERAND and REG_LABEL_TARGET. (fill_slots_from_thread): Handle both REG_LABEL_OPERAND and REG_LABEL_TARGET notes, including the JUMP_TARGET field on JUMP_P insns. Iterate over all notes; don't assume there's only one. * cse.c (recorded_label_ref): Adjust comment to refer to REG_LABEL_OPERAND. (cse_extended_basic_block): Do LABEL_REF check for all INSN_P insns, not just NONJUMP_INSN_P. (check_for_label_ref): For JUMP_P insns, check that the LABEL_REF isn't a jump target. * jump.c (rebuild_jump_labels): Adjust head comment. (init_label_info): Ditto. Remove REG_LABEL_OPERAND notes only; don't reset REG_LABEL_TARGET notes, including the JUMP_LABEL field. (mark_all_labels): For JUMP_P insns without a target, check if the the target is noted on the previous nonjump insn. (mark_jump_label_1): New function, guts from mark_jump_label. <case IF_THEN_ELSE>: Handle first operand as a non-target when marking jump target labels. <case LABEL_REF>: Adjust for whether to generate a REG_LABEL_TARGET or a REG_LABEL_OPERAND note. For 'E' format rtl, iterate in descending element order. (delete_related_insns): Handle both REG_LABEL_TARGET and REG_LABEL_OPERAND notes. For JUMP_P insns with labels with zero reference count, delete and fallthrough. Move finding-next- non-deleted insn last in the function. Look at all INSN_P insns for REG_LABEL_OPERAND notes. (redirect_jump_2): Assert that OLABEL equals the old JUMP_LABEL of JUMP. * print-rtl.c (print_rtx): For JUMP_P insns and a non-NULL JUMP_LABEL, output the INSN_UID of it. * gcse.c: Adjust comments as appropriate to say REG_LABEL_OPERAND and/or REG_LABEL_TARGET. (add_label_notes): Only add REG_LABEL_OPERAND notes. Put in line with jump.c copy by only adding notes for labels actually referenced in the insn. * emit-rtl.c (try_split): Don't assume only NONJUMP_INSN_P need usage count increment; handle all INSN_P trial insns. (emit_copy_of_insn_after): Change to not copy REG_LABEL_OPERAND notes. * rtl.h (struct rtx_def) <volatil>: Adjust to mention REG_LABEL_TARGET and REG_LABEL_OPERAND. (LABEL_REF_NONLOCAL_P): Allow REG_LABEL_TARGET and REG_LABEL_OPERAND. * combine.c (distribute_notes): Adjust for REG_LABEL_TARGET on JUMP_P insns and REG_LABEL_OPERAND everywhere. * sched-rgn.c (is_cfg_nonregular): Check for REG_LABEL_OPERANDS on all INSN_P insns. * reg-notes.def (LABEL_TARGET, LABEL_OPERAND): Split from LABEL. * cfgrtl.c (delete_insn): Adjust to handle REG_LABEL_TARGET and REG_LABEL_OPERAND notes. * reload1.c (calculate_needs_all_insns): Adjust comments. (set_label_offsets): Adjust to look for REG_LABEL_OPERAND notes. * config/alpha/alpha.md (split for load of an address into a four-insn sequence on Unicos/Mk): Adjust to use REG_LABEL_OPERAND. * config/sh/sh.md (sh_reorg, final_prescan_insn): Ditto. From-SVN: r128287
2007-09-09 06:41:58 +02:00
note = find_reg_note (insn, REG_LABEL_OPERAND, NULL_RTX);
if (note)
{
rtx pattern;
pattern = PATTERN (insn);
if (GET_CODE (pattern) == PARALLEL)
pattern = XVECEXP (pattern, 0, 0);
switch (GET_CODE (pattern))
{
case SET:
if (GET_CODE (SET_SRC (pattern)) != CALL
&& get_attr_type (insn) != TYPE_SFUNC)
{
targetm.asm_out.internal_label
(asm_out_file, "L", CODE_LABEL_NUMBER (XEXP (note, 0)));
break;
}
/* else FALLTHROUGH */
case CALL:
asm_fprintf (asm_out_file, "\t.uses %LL%d\n",
CODE_LABEL_NUMBER (XEXP (note, 0)));
break;
default:
gcc_unreachable ();
}
}
}
}
1993-06-29 02:10:35 +02:00
1995-04-21 03:19:27 +02:00
/* Dump out any constants accumulated in the final pass. These will
1998-05-06 23:09:07 +02:00
only be labels. */
1993-06-29 02:10:35 +02:00
const char *
output_jump_label_table (void)
{
1995-04-21 03:19:27 +02:00
int i;
if (pool_size)
{
fprintf (asm_out_file, "\t.align 2\n");
for (i = 0; i < pool_size; i++)
{
pool_node *p = &pool_vector[i];
(*targetm.asm_out.internal_label) (asm_out_file, "L",
1995-04-21 03:19:27 +02:00
CODE_LABEL_NUMBER (p->label));
output_asm_insn (".long %O0", &p->value);
}
pool_size = 0;
}
1993-06-29 02:10:35 +02:00
1995-04-21 03:19:27 +02:00
return "";
}
/* A full frame looks like:
arg-5
arg-4
[ if current_function_anonymous_args
arg-3
arg-2
arg-1
arg-0 ]
saved-fp
saved-r10
saved-r11
saved-r12
saved-pr
local-n
..
local-1
local-0 <- fp points here. */
1995-04-21 03:19:27 +02:00
/* Number of bytes pushed for anonymous args, used to pass information
between expand_prologue and expand_epilogue. */
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
/* Adjust the stack by SIZE bytes. REG holds the rtl of the register to be
adjusted. If epilogue_p is zero, this is for a prologue; otherwise, it's
for an epilogue and a negative value means that it's for a sibcall
epilogue. If LIVE_REGS_MASK is nonzero, it points to a HARD_REG_SET of
all the registers that are about to be restored, and hence dead. */
1995-04-21 03:19:27 +02:00
static void
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
output_stack_adjust (int size, rtx reg, int epilogue_p,
HARD_REG_SET *live_regs_mask, bool frame_p)
1995-04-21 03:19:27 +02:00
{
rtx (*emit_fn) (rtx) = frame_p ? &frame_insn : &emit_insn;
1995-04-21 03:19:27 +02:00
if (size)
{
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT;
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
/* This test is bogus, as output_stack_adjust is used to re-align the
stack. */
#if 0
gcc_assert (!(size % align));
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
#endif
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (CONST_OK_FOR_ADD (size))
emit_fn (GEN_ADD3 (reg, reg, GEN_INT (size)));
/* Try to do it with two partial adjustments; however, we must make
sure that the stack is properly aligned at all times, in case
an interrupt occurs between the two partial adjustments. */
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
else if (CONST_OK_FOR_ADD (size / 2 & -align)
&& CONST_OK_FOR_ADD (size - (size / 2 & -align)))
{
emit_fn (GEN_ADD3 (reg, reg, GEN_INT (size / 2 & -align)));
emit_fn (GEN_ADD3 (reg, reg, GEN_INT (size - (size / 2 & -align))));
}
else
1995-04-21 03:19:27 +02:00
{
rtx const_reg;
rtx insn;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
int temp = epilogue_p ? 7 : (TARGET_SH5 ? 0 : 1);
int i;
/* If TEMP is invalid, we could temporarily save a general
register to MACL. However, there is currently no need
to handle this case, so just die when we see it. */
if (epilogue_p < 0
|| current_function_interrupt
|| ! call_really_used_regs[temp] || fixed_regs[temp])
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
temp = -1;
if (temp < 0 && ! current_function_interrupt
&& (TARGET_SHMEDIA || epilogue_p >= 0))
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
{
HARD_REG_SET temps;
COPY_HARD_REG_SET (temps, call_used_reg_set);
AND_COMPL_HARD_REG_SET (temps, call_fixed_reg_set);
if (epilogue_p > 0)
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
{
int nreg = 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
if (crtl->return_rtx)
{
enum machine_mode mode;
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
mode = GET_MODE (crtl->return_rtx);
if (BASE_RETURN_VALUE_REG (mode) == FIRST_RET_REG)
nreg = HARD_REGNO_NREGS (FIRST_RET_REG, mode);
}
for (i = 0; i < nreg; i++)
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
CLEAR_HARD_REG_BIT (temps, FIRST_RET_REG + i);
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->calls_eh_return)
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
{
CLEAR_HARD_REG_BIT (temps, EH_RETURN_STACKADJ_REGNO);
for (i = 0; i <= 3; i++)
CLEAR_HARD_REG_BIT (temps, EH_RETURN_DATA_REGNO (i));
}
}
if (TARGET_SHMEDIA && epilogue_p < 0)
for (i = FIRST_TARGET_REG; i <= LAST_TARGET_REG; i++)
CLEAR_HARD_REG_BIT (temps, i);
if (epilogue_p <= 0)
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
{
for (i = FIRST_PARM_REG;
i < FIRST_PARM_REG + NPARM_REGS (SImode); i++)
CLEAR_HARD_REG_BIT (temps, i);
if (cfun->static_chain_decl != NULL)
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
CLEAR_HARD_REG_BIT (temps, STATIC_CHAIN_REGNUM);
}
temp = scavenge_reg (&temps);
}
if (temp < 0 && live_regs_mask)
{
HARD_REG_SET temps;
COPY_HARD_REG_SET (temps, *live_regs_mask);
CLEAR_HARD_REG_BIT (temps, REGNO (reg));
temp = scavenge_reg (&temps);
}
if (temp < 0)
{
rtx adj_reg, tmp_reg, mem;
/* If we reached here, the most likely case is the (sibcall)
epilogue for non SHmedia. Put a special push/pop sequence
for such case as the last resort. This looks lengthy but
would not be problem because it seems to be very
rare. */
gcc_assert (!TARGET_SHMEDIA && epilogue_p);
/* ??? There is still the slight possibility that r4 or
r5 have been reserved as fixed registers or assigned
as global registers, and they change during an
interrupt. There are possible ways to handle this:
- If we are adjusting the frame pointer (r14), we can do
with a single temp register and an ordinary push / pop
on the stack.
- Grab any call-used or call-saved registers (i.e. not
fixed or globals) for the temps we need. We might
also grab r14 if we are adjusting the stack pointer.
If we can't find enough available registers, issue
a diagnostic and die - the user must have reserved
way too many registers.
But since all this is rather unlikely to happen and
would require extra testing, we just die if r4 / r5
are not available. */
gcc_assert (!fixed_regs[4] && !fixed_regs[5]
&& !global_regs[4] && !global_regs[5]);
adj_reg = gen_rtx_REG (GET_MODE (reg), 4);
tmp_reg = gen_rtx_REG (GET_MODE (reg), 5);
emit_move_insn (gen_tmp_stack_mem (Pmode, reg), adj_reg);
emit_insn (GEN_MOV (adj_reg, GEN_INT (size)));
emit_insn (GEN_ADD3 (adj_reg, adj_reg, reg));
mem = gen_tmp_stack_mem (Pmode, gen_rtx_PRE_DEC (Pmode, adj_reg));
emit_move_insn (mem, tmp_reg);
emit_move_insn (tmp_reg, gen_tmp_stack_mem (Pmode, reg));
mem = gen_tmp_stack_mem (Pmode, gen_rtx_PRE_DEC (Pmode, adj_reg));
emit_move_insn (mem, tmp_reg);
emit_move_insn (reg, adj_reg);
mem = gen_tmp_stack_mem (Pmode, gen_rtx_POST_INC (Pmode, reg));
emit_move_insn (adj_reg, mem);
mem = gen_tmp_stack_mem (Pmode, gen_rtx_POST_INC (Pmode, reg));
emit_move_insn (tmp_reg, mem);
/* Tell flow the insns that pop r4/r5 aren't dead. */
rtl.h (emit_clobber, [...]): Declare. gcc/ * rtl.h (emit_clobber, gen_clobber, emit_use, gen_use): Declare. * emit-rtl.c (emit_clobber, gen_clobber, emit_use, gen_use): New functions. Do not emit uses and clobbers of CONCATs; individually use and clobber their operands. * builtins.c (expand_builtin_setjmp_receiver): Use emit_clobber, gen_clobber, emit_use and gen_use. (expand_builtin_longjmp, expand_builtin_nonlocal_goto): Likewise. (expand_builtin_return): Likewise. * cfgbuild.c (count_basic_blocks): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * explow.c (emit_stack_restore): Likewise. * expmed.c (extract_bit_field_1): Likewise. * expr.c (convert_move, emit_move_complex_parts): Likewise. (emit_move_multi_word, store_constructor): Likewise. * function.c (do_clobber_return_reg, do_use_return_reg): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * optabs.c (widen_operand, expand_binop): Likewise. (expand_doubleword_bswap, emit_no_conflict_block): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (eliminate_regs_in_insn): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * config/alpha/alpha.md (builtin_longjmp): Likewise. * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. * config/arm/arm.c (arm_load_pic_register): Likewise. (thumb1_expand_epilogue, thumb_set_return_address): Likewise. * config/arm/arm.md (untyped_return): Likewise. * config/arm/linux-elf.h (PROFILE_HOOK): Likewise. * config/avr/avr.c (expand_prologue): Likewise. * config/bfin/bfin.c (do_unlink): Likewise. * config/bfin/bfin.md (<optab>di3, adddi3, subdi3): Likewise. * config/cris/cris.c (cris_expand_prologue): Likewise. * config/darwin.c (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/frv/frv.c (frv_frame_access, frv_expand_epilogue): Likewise. (frv_ifcvt_modify_insn, frv_expand_mdpackh_builtin): Likewise. * config/i386/i386.c (ix86_expand_vector_move_misalign): Likewise. (ix86_expand_convert_uns_didf_sse): Likewise. (ix86_expand_vector_init_general): Likewise. * config/ia64/ia64.md (eh_epilogue): Likewise. * config/iq2000/iq2000.c (iq2000_expand_epilogue): Likewise. * config/m32c/m32c.c (m32c_emit_eh_epilogue): Likewise. * config/m32r/m32r.c (m32r_reload_lr): Likewise. (config/iq2000/iq2000.c): Likewise. * config/mips/mips.md (fixuns_truncdfsi2): Likewise. (fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise. (builtin_longjmp): Likewise. * config/mn10300/mn10300.md (call, call_value): Likewise. * config/pa/pa.md (nonlocal_goto, nonlocal_longjmp): Likewise. * config/pdp11/pdp11.md (abshi2): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. * config/s390/s390.c (s390_emit_prologue): Likewise. * config/s390/s390.md (movmem_long, setmem_long): Likewise. (cmpmem_long, extendsidi2, zero_extendsidi2, udivmoddi4): Likewise. (builtin_setjmp_receiver, restore_stack_nonlocal): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (output_stack_adjust, sh_expand_epilogue): Likewise. (sh_set_return_address, sh_expand_t_scc): Likewise. * config/sparc/sparc.c (load_pic_register): Likewise. * config/sparc/sparc.md (untyped_return, nonlocal_goto): Likewise. * config/spu/spu.c (spu_expand_epilogue): Likewise. * config/v850/v850.c (expand_epilogue): Likewise. From-SVN: r136251
2008-06-01 11:47:28 +02:00
emit_use (tmp_reg);
emit_use (adj_reg);
return;
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
const_reg = gen_rtx_REG (GET_MODE (reg), temp);
/* If SIZE is negative, subtract the positive value.
This sometimes allows a constant pool entry to be shared
between prologue and epilogue code. */
if (size < 0)
{
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
emit_insn (GEN_MOV (const_reg, GEN_INT (-size)));
insn = emit_fn (GEN_SUB3 (reg, reg, const_reg));
}
else
{
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
emit_insn (GEN_MOV (const_reg, GEN_INT (size)));
insn = emit_fn (GEN_ADD3 (reg, reg, const_reg));
}
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, reg,
gen_rtx_PLUS (SImode, reg,
GEN_INT (size))));
1995-04-21 03:19:27 +02:00
}
}
}
static rtx
frame_insn (rtx x)
{
x = emit_insn (x);
RTX_FRAME_RELATED_P (x) = 1;
return x;
}
1995-04-21 03:19:27 +02:00
/* Output RTL to push register RN onto the stack. */
static rtx
push (int rn)
1995-04-21 03:19:27 +02:00
{
rtx x;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (rn == FPUL_REG)
x = gen_push_fpul ();
else if (rn == FPSCR_REG)
x = gen_push_fpscr ();
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
else if ((TARGET_SH4 || TARGET_SH2A_DOUBLE) && TARGET_FMOVD && ! TARGET_FPU_SINGLE
&& FP_OR_XD_REGISTER_P (rn))
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
if (FP_REGISTER_P (rn) && (rn - FIRST_FP_REG) & 1)
return NULL_RTX;
x = gen_push_4 (gen_rtx_REG (DFmode, rn));
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
else if (TARGET_SH2E && FP_REGISTER_P (rn))
x = gen_push_e (gen_rtx_REG (SFmode, rn));
else
x = gen_push (gen_rtx_REG (SImode, rn));
x = frame_insn (x);
add_reg_note (x, REG_INC, gen_rtx_REG (SImode, STACK_POINTER_REGNUM));
return x;
1995-04-21 03:19:27 +02:00
}
/* Output RTL to pop register RN from the stack. */
static void
pop (int rn)
1995-04-21 03:19:27 +02:00
{
rtx x, sp_reg, reg;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
if (rn == FPUL_REG)
x = gen_pop_fpul ();
else if (rn == FPSCR_REG)
x = gen_pop_fpscr ();
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
else if ((TARGET_SH4 || TARGET_SH2A_DOUBLE) && TARGET_FMOVD && ! TARGET_FPU_SINGLE
&& FP_OR_XD_REGISTER_P (rn))
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
if (FP_REGISTER_P (rn) && (rn - FIRST_FP_REG) & 1)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
return;
x = gen_pop_4 (gen_rtx_REG (DFmode, rn));
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
else if (TARGET_SH2E && FP_REGISTER_P (rn))
x = gen_pop_e (gen_rtx_REG (SFmode, rn));
else
x = gen_pop (gen_rtx_REG (SImode, rn));
x = emit_insn (x);
sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM);
reg = copy_rtx (GET_CODE (PATTERN (x)) == PARALLEL
? SET_DEST (XVECEXP (PATTERN (x), 0, 0))
: SET_DEST (PATTERN (x)));
add_reg_note (x, REG_CFA_RESTORE, reg);
add_reg_note (x, REG_CFA_ADJUST_CFA,
gen_rtx_SET (SImode, sp_reg,
plus_constant (SImode, sp_reg,
GET_MODE_SIZE (GET_MODE (reg)))));
add_reg_note (x, REG_INC, gen_rtx_REG (SImode, STACK_POINTER_REGNUM));
RTX_FRAME_RELATED_P (x) = 1;
1995-04-21 03:19:27 +02:00
}
/* Generate code to push the regs specified in the mask. */
1995-04-21 03:19:27 +02:00
static void
push_regs (HARD_REG_SET *mask, int interrupt_handler)
1995-04-21 03:19:27 +02:00
{
int i = interrupt_handler ? LAST_BANKED_REG + 1 : 0;
int skip_fpscr = 0;
1995-04-21 03:19:27 +02:00
/* Push PR last; this gives better latencies after the prologue, and
candidates for the return delay slot when there are no general
registers pushed. */
for (; i < FIRST_PSEUDO_REGISTER; i++)
{
/* If this is an interrupt handler, and the SZ bit varies,
and we have to push any floating point register, we need
to switch to the correct precision first. */
if (i == FIRST_FP_REG && interrupt_handler && TARGET_FMOVD
&& hard_reg_set_intersect_p (*mask, reg_class_contents[DF_REGS]))
{
HARD_REG_SET unsaved;
push (FPSCR_REG);
COMPL_HARD_REG_SET (unsaved, *mask);
fpscr_set_from_mem (NORMAL_MODE (FP_MODE), unsaved);
skip_fpscr = 1;
}
if (i != PR_REG
&& (i != FPSCR_REG || ! skip_fpscr)
&& TEST_HARD_REG_BIT (*mask, i))
{
/* If the ISR has RESBANK attribute assigned, don't push any of
the following registers - R0-R14, MACH, MACL and GBR. */
if (! (sh_cfun_resbank_handler_p ()
&& ((i >= FIRST_GENERAL_REG && i < LAST_GENERAL_REG)
|| i == MACH_REG
|| i == MACL_REG
|| i == GBR_REG)))
push (i);
}
}
/* Push banked registers last to improve delay slot opportunities. */
if (interrupt_handler)
{
bool use_movml = false;
if (TARGET_SH2A)
{
unsigned int count = 0;
for (i = FIRST_BANKED_REG; i <= LAST_BANKED_REG; i++)
if (TEST_HARD_REG_BIT (*mask, i))
count++;
else
break;
/* Use movml when all banked registers are pushed. */
if (count == LAST_BANKED_REG - FIRST_BANKED_REG + 1)
use_movml = true;
}
if (sh_cfun_resbank_handler_p ())
; /* Do nothing. */
else if (use_movml)
{
rtx x, mem, reg, set;
rtx sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM);
/* We must avoid scheduling multiple store insn with another
insns. */
emit_insn (gen_blockage ());
x = gen_movml_push_banked (sp_reg);
x = frame_insn (x);
for (i = FIRST_BANKED_REG; i <= LAST_BANKED_REG; i++)
{
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
mem = gen_rtx_MEM (SImode, plus_constant (Pmode, sp_reg, i * 4));
reg = gen_rtx_REG (SImode, i);
add_reg_note (x, REG_CFA_OFFSET, gen_rtx_SET (SImode, mem, reg));
}
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
set = gen_rtx_SET (SImode, sp_reg,
plus_constant (Pmode, sp_reg, - 32));
add_reg_note (x, REG_CFA_ADJUST_CFA, set);
emit_insn (gen_blockage ());
}
else
for (i = FIRST_BANKED_REG; i <= LAST_BANKED_REG; i++)
if (TEST_HARD_REG_BIT (*mask, i))
push (i);
}
/* Don't push PR register for an ISR with RESBANK attribute assigned. */
if (TEST_HARD_REG_BIT (*mask, PR_REG) && !sh_cfun_resbank_handler_p ())
push (PR_REG);
1995-04-21 03:19:27 +02:00
}
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
/* Calculate how much extra space is needed to save all callee-saved
target registers.
LIVE_REGS_MASK is the register mask calculated by calc_live_regs. */
static int
shmedia_target_regs_stack_space (HARD_REG_SET *live_regs_mask)
{
int reg;
int stack_space = 0;
int interrupt_handler = sh_cfun_interrupt_handler_p ();
for (reg = LAST_TARGET_REG; reg >= FIRST_TARGET_REG; reg--)
if ((! call_really_used_regs[reg] || interrupt_handler)
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
&& ! TEST_HARD_REG_BIT (*live_regs_mask, reg))
/* Leave space to save this target register on the stack,
in case target register allocation wants to use it. */
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
stack_space += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
return stack_space;
}
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
/* Decide whether we should reserve space for callee-save target registers,
in case target register allocation wants to use them. REGS_SAVED is
the space, in bytes, that is already required for register saves.
LIVE_REGS_MASK is the register mask calculated by calc_live_regs. */
static int
shmedia_reserve_space_for_target_registers_p (int regs_saved,
HARD_REG_SET *live_regs_mask)
{
if (optimize_size)
return 0;
return shmedia_target_regs_stack_space (live_regs_mask) <= regs_saved;
}
/* Decide how much space to reserve for callee-save target registers
in case target register allocation wants to use them.
LIVE_REGS_MASK is the register mask calculated by calc_live_regs. */
static int
shmedia_target_regs_stack_adjust (HARD_REG_SET *live_regs_mask)
{
if (shmedia_space_reserved_for_target_registers)
return shmedia_target_regs_stack_space (live_regs_mask);
else
return 0;
}
1995-04-21 03:19:27 +02:00
/* Work out the registers which need to be saved, both as a mask and a
count of saved words. Return the count.
1995-04-21 03:19:27 +02:00
If doing a pragma interrupt function, then push all regs used by the
function, and if we call another function (we can tell by looking at PR),
make sure that all the regs it clobbers are safe too. */
static int
calc_live_regs (HARD_REG_SET *live_regs_mask)
1995-04-21 03:19:27 +02:00
{
unsigned int reg;
int count;
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
tree attrs;
bool interrupt_or_trapa_handler, trapa_handler, interrupt_handler;
bool nosave_low_regs;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
int pr_live, has_call;
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
attrs = DECL_ATTRIBUTES (current_function_decl);
interrupt_or_trapa_handler = sh_cfun_interrupt_handler_p ();
trapa_handler = lookup_attribute ("trapa_handler", attrs) != NULL_TREE;
interrupt_handler = interrupt_or_trapa_handler && ! trapa_handler;
nosave_low_regs = lookup_attribute ("nosave_low_regs", attrs) != NULL_TREE;
1995-04-21 03:19:27 +02:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
CLEAR_HARD_REG_SET (*live_regs_mask);
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
if ((TARGET_SH4 || TARGET_SH2A_DOUBLE) && TARGET_FMOVD && interrupt_handler
&& df_regs_ever_live_p (FPSCR_REG))
config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config/sh/sh.h: Update mask names throughout. (target_flags, ISIZE_BIT, DALIGN_BIT, SH1_BIT, SH2_BIT, SH3_BIT) (SH_E_BIT, HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, SH4A_BIT, FMOVD_BIT) (SH5_BIT, SPACE_BIT, BIGTABLE_BIT, RELAX_BIT, USERMODE_BIT) (HITACHI_BIT, NOMACSAVE_BIT, PREFERGOT_BIT, PADSTRUCT_BIT) (LITTLE_ENDIAN_BIT, IEEE_BIT, SAVE_ALL_TR_BIT, HARD_SH2A_BIT) (HARD_SH2A_DOUBLE_BIT, INDEXED_ADDRESS_BIT, PT_FIXED_BIT) (INVALID_SYMBOLS_BIT, ADJUST_UNROLL_BIT, TARGET_DUMPISIZE) (TARGET_ALIGN_DOUBLE, TARGET_SH1, TARGET_SH2, TARGET_SH3) (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH5, TARGET_FMOVD) (TARGET_IEEE, TARGET_SMALLCODE, TARGET_BIGTABLE, TARGET_RELAX) (TARGET_HITACHI, TARGET_NOMACSAVE, TARGET_PADSTRUCT) (TARGET_LITTLE_ENDIAN, TARGET_USERMODE, TARGET_PREFERGOT) (TARGET_SAVE_ALL_TARGET_REGS, TARGET_ALLOW_INDEXED_ADDRESS) (TARGET_PT_FIXED, TARGET_INVALID_SYMBOLS, TARGET_ADJUST_UNROLL) (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E) (TARGET_SWITCH_SH2A, TARGET_SWITCH_SH2A_SINGLE_ONLY) (TARGET_SWITCH_SH2A_SINGLE, TARGET_SWITCH_SH2A_NOFPU) (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E, TARGET_SWITCH_SH4_SINGLE_ONLY) (TARGET_SWITCH_SH4_SINGLE, TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4) (TARGET_SWITCH_SH4A, TARGET_SWITCH_SH4A_SINGLE_ONLY) (TARGET_SWITCH_SH4A_SINGLE, TARGET_SWITCH_SH4A_NOFPU) (TARGET_SWITCH_SH4AL, TARGET_SWITCH_SH5_64MEDIA) (TARGET_SWITCH_SH5_64MEDIA_NOFPU, TARGET_SWITCHES_SH5_32MEDIA) (TARGET_SWITCHES_SH5_32MEDIA_NOFPU, TARGET_SWITCH_SH5_32_ANY_EXTRA) (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA, TARGET_SWITCHES) (SUBTARGET_SWITCHES): Delete. (TARGET_SH2E, TARGET_SH2A, TARGET_SH2A_SINGLE, TARGET_SH2A_DOUBLE) (TARGET_SH3E, TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARVARD) (TARGET_FPU_DOUBLE, TARGET_SH4A_ARCH, TARGET_SHMEDIA32) (TARGET_SHMEDIA64): Redefine using other TARGET_* macros. (TARGET_SH4): Undefine options.h definition and check MASK_SH1 as well. (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4, SUPPORT_SH4_SINGLE) (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Make numeric. (SUPPORT_SH2): Define to 1 if SUPPORT_SH1. (SUPPORT_SH3): Likewise SUPPORT_SH2. (SUPPORT_SH4_NOFPU): Likewise SUPPORT_SH3. (SUPPORT_SH4A_NOFPU, SUPPORT_SH4AL, SUPPORT_SH2A_NOFPU): Likewise SUPPORT_SH4_NOFPU. (SUPPORT_SH3E): Likewise SUPPORT_SH2E. (SUPPORT_SH4_SINGLE_ONLY, SUPPORT_SH4A_SINGLE_ONLY) (SUPPORT_SH2A_SINGLE_ONLY): Likewise SUPPORT_SH3E. (SUPPORT_SH4A): Likewise SUPPORT_SH4. (SUPPORT_SH4A_SINGLE): Likewise SUPPORT_SH4_SINGLE. (SUPPORT_SH5_32MEDIA): Likewise SUPPORT_SH5_COMPACT. (SUPPORT_SH5_32MEDIA_NOFPU): Likewise SUPPORT_SH5_COMPACT_NOFPU. (SUPPORT_ANY_SH5_32MEDIA, SUPPORT_ANY_SH5_64MEDIA) (SUPPORT_ANY_SH5): New macros. (TARGET_NONE): Replace with... (MASK_ARCH): ...this new macro. * config/sh/elf.h: Update mask names * config/sh/linux.h: Likewise. * config/sh/little.h: Likewise. * config/sh/netbsd-elf.h: Likewise. * config/sh/symbian-pre.h: Likewise. * config/sh/sh.c (sh_handle_option): New function. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. (calc_live_regs): Use MASK_FPU_SINGLE instead of FPU_SINGLE_BIT. (sh_target_switches, target_switches): Delete. (sh_pch_valid_p): Check for specific differences in the target_flags settings. (sh_init_cumulative_args): Use MASK_HITACHI instead of HITACHI_BIT. * config/sh/sh.opt: New file. From-SVN: r99916
2005-05-18 20:43:53 +02:00
target_flags &= ~MASK_FPU_SINGLE;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
/* If we can save a lot of saves by switching to double mode, do that. */
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
else if ((TARGET_SH4 || TARGET_SH2A_DOUBLE) && TARGET_FMOVD && TARGET_FPU_SINGLE)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
for (count = 0, reg = FIRST_FP_REG; reg <= LAST_FP_REG; reg += 2)
if (df_regs_ever_live_p (reg) && df_regs_ever_live_p (reg+1)
&& (! call_really_used_regs[reg]
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
|| interrupt_handler)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
&& ++count > 2)
{
config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config/sh/sh.h: Update mask names throughout. (target_flags, ISIZE_BIT, DALIGN_BIT, SH1_BIT, SH2_BIT, SH3_BIT) (SH_E_BIT, HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, SH4A_BIT, FMOVD_BIT) (SH5_BIT, SPACE_BIT, BIGTABLE_BIT, RELAX_BIT, USERMODE_BIT) (HITACHI_BIT, NOMACSAVE_BIT, PREFERGOT_BIT, PADSTRUCT_BIT) (LITTLE_ENDIAN_BIT, IEEE_BIT, SAVE_ALL_TR_BIT, HARD_SH2A_BIT) (HARD_SH2A_DOUBLE_BIT, INDEXED_ADDRESS_BIT, PT_FIXED_BIT) (INVALID_SYMBOLS_BIT, ADJUST_UNROLL_BIT, TARGET_DUMPISIZE) (TARGET_ALIGN_DOUBLE, TARGET_SH1, TARGET_SH2, TARGET_SH3) (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH5, TARGET_FMOVD) (TARGET_IEEE, TARGET_SMALLCODE, TARGET_BIGTABLE, TARGET_RELAX) (TARGET_HITACHI, TARGET_NOMACSAVE, TARGET_PADSTRUCT) (TARGET_LITTLE_ENDIAN, TARGET_USERMODE, TARGET_PREFERGOT) (TARGET_SAVE_ALL_TARGET_REGS, TARGET_ALLOW_INDEXED_ADDRESS) (TARGET_PT_FIXED, TARGET_INVALID_SYMBOLS, TARGET_ADJUST_UNROLL) (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E) (TARGET_SWITCH_SH2A, TARGET_SWITCH_SH2A_SINGLE_ONLY) (TARGET_SWITCH_SH2A_SINGLE, TARGET_SWITCH_SH2A_NOFPU) (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E, TARGET_SWITCH_SH4_SINGLE_ONLY) (TARGET_SWITCH_SH4_SINGLE, TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4) (TARGET_SWITCH_SH4A, TARGET_SWITCH_SH4A_SINGLE_ONLY) (TARGET_SWITCH_SH4A_SINGLE, TARGET_SWITCH_SH4A_NOFPU) (TARGET_SWITCH_SH4AL, TARGET_SWITCH_SH5_64MEDIA) (TARGET_SWITCH_SH5_64MEDIA_NOFPU, TARGET_SWITCHES_SH5_32MEDIA) (TARGET_SWITCHES_SH5_32MEDIA_NOFPU, TARGET_SWITCH_SH5_32_ANY_EXTRA) (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA, TARGET_SWITCHES) (SUBTARGET_SWITCHES): Delete. (TARGET_SH2E, TARGET_SH2A, TARGET_SH2A_SINGLE, TARGET_SH2A_DOUBLE) (TARGET_SH3E, TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARVARD) (TARGET_FPU_DOUBLE, TARGET_SH4A_ARCH, TARGET_SHMEDIA32) (TARGET_SHMEDIA64): Redefine using other TARGET_* macros. (TARGET_SH4): Undefine options.h definition and check MASK_SH1 as well. (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4, SUPPORT_SH4_SINGLE) (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Make numeric. (SUPPORT_SH2): Define to 1 if SUPPORT_SH1. (SUPPORT_SH3): Likewise SUPPORT_SH2. (SUPPORT_SH4_NOFPU): Likewise SUPPORT_SH3. (SUPPORT_SH4A_NOFPU, SUPPORT_SH4AL, SUPPORT_SH2A_NOFPU): Likewise SUPPORT_SH4_NOFPU. (SUPPORT_SH3E): Likewise SUPPORT_SH2E. (SUPPORT_SH4_SINGLE_ONLY, SUPPORT_SH4A_SINGLE_ONLY) (SUPPORT_SH2A_SINGLE_ONLY): Likewise SUPPORT_SH3E. (SUPPORT_SH4A): Likewise SUPPORT_SH4. (SUPPORT_SH4A_SINGLE): Likewise SUPPORT_SH4_SINGLE. (SUPPORT_SH5_32MEDIA): Likewise SUPPORT_SH5_COMPACT. (SUPPORT_SH5_32MEDIA_NOFPU): Likewise SUPPORT_SH5_COMPACT_NOFPU. (SUPPORT_ANY_SH5_32MEDIA, SUPPORT_ANY_SH5_64MEDIA) (SUPPORT_ANY_SH5): New macros. (TARGET_NONE): Replace with... (MASK_ARCH): ...this new macro. * config/sh/elf.h: Update mask names * config/sh/linux.h: Likewise. * config/sh/little.h: Likewise. * config/sh/netbsd-elf.h: Likewise. * config/sh/symbian-pre.h: Likewise. * config/sh/sh.c (sh_handle_option): New function. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. (calc_live_regs): Use MASK_FPU_SINGLE instead of FPU_SINGLE_BIT. (sh_target_switches, target_switches): Delete. (sh_pch_valid_p): Check for specific differences in the target_flags settings. (sh_init_cumulative_args): Use MASK_HITACHI instead of HITACHI_BIT. * config/sh/sh.opt: New file. From-SVN: r99916
2005-05-18 20:43:53 +02:00
target_flags &= ~MASK_FPU_SINGLE;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
break;
}
/* PR_MEDIA_REG is a general purpose register, thus global_alloc already
knows how to use it. That means the pseudo originally allocated for
the initial value can become the PR_MEDIA_REG hard register, as seen for
execute/20010122-1.c:test9. */
if (TARGET_SHMEDIA)
/* ??? this function is called from initial_elimination_offset, hence we
can't use the result of sh_media_register_for_return here. */
pr_live = sh_pr_n_sets ();
else
{
rtx pr_initial = has_hard_reg_initial_val (Pmode, PR_REG);
pr_live = (pr_initial
? (!REG_P (pr_initial)
|| REGNO (pr_initial) != (PR_REG))
: df_regs_ever_live_p (PR_REG));
/* For Shcompact, if not optimizing, we end up with a memory reference
using the return address pointer for __builtin_return_address even
though there is no actual need to put the PR register on the stack. */
pr_live |= df_regs_ever_live_p (RETURN_ADDRESS_POINTER_REGNUM);
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* Force PR to be live if the prologue has to call the SHmedia
argument decoder or register saver. */
if (TARGET_SHCOMPACT
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->args.info.call_cookie
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
& ~ CALL_COOKIE_RET_TRAMP (1))
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->saves_all_registers))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
pr_live = 1;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
has_call = TARGET_SHMEDIA ? ! leaf_function_p () : pr_live;
for (count = 0, reg = FIRST_PSEUDO_REGISTER; reg-- != 0; )
1995-04-21 03:19:27 +02:00
{
if (reg == (TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG)
? pr_live
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
: interrupt_handler
? (/* Need to save all the regs ever live. */
(df_regs_ever_live_p (reg)
|| (call_really_used_regs[reg]
&& (! fixed_regs[reg] || reg == MACH_REG || reg == MACL_REG
|| reg == PIC_OFFSET_TABLE_REGNUM)
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
&& has_call)
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
|| (TARGET_SHMEDIA && has_call
&& REGISTER_NATURAL_MODE (reg) == SImode
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
&& (GENERAL_REGISTER_P (reg) || TARGET_REGISTER_P (reg))))
&& reg != STACK_POINTER_REGNUM && reg != ARG_POINTER_REGNUM
&& reg != RETURN_ADDRESS_POINTER_REGNUM
&& reg != T_REG && reg != GBR_REG
/* Push fpscr only on targets which have FPU */
&& (reg != FPSCR_REG || TARGET_FPU_ANY))
: (/* Only push those regs which are used and need to be saved. */
(TARGET_SHCOMPACT
&& flag_pic
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->args.info.call_cookie
&& reg == PIC_OFFSET_TABLE_REGNUM)
|| (df_regs_ever_live_p (reg)
&& ((!call_really_used_regs[reg]
&& !(reg != PIC_OFFSET_TABLE_REGNUM
&& fixed_regs[reg] && call_used_regs[reg]))
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
|| (trapa_handler && reg == FPSCR_REG && TARGET_FPU_ANY)))
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->calls_eh_return
&& (reg == EH_RETURN_DATA_REGNO (0)
|| reg == EH_RETURN_DATA_REGNO (1)
|| reg == EH_RETURN_DATA_REGNO (2)
|| reg == EH_RETURN_DATA_REGNO (3)))
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
|| ((reg == MACL_REG || reg == MACH_REG)
&& df_regs_ever_live_p (reg)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
&& sh_cfun_attr_renesas_p ())
))
1995-04-21 03:19:27 +02:00
{
SET_HARD_REG_BIT (*live_regs_mask, reg);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
if ((TARGET_SH4 || TARGET_SH2A_DOUBLE || TARGET_SH5) && TARGET_FMOVD
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
&& GET_MODE_CLASS (REGISTER_NATURAL_MODE (reg)) == MODE_FLOAT)
{
if (FP_REGISTER_P (reg))
{
if (! TARGET_FPU_SINGLE && ! df_regs_ever_live_p (reg ^ 1))
{
SET_HARD_REG_BIT (*live_regs_mask, (reg ^ 1));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg ^ 1));
}
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
else if (XD_REGISTER_P (reg))
{
/* Must switch to double mode to access these registers. */
config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config/sh/sh.h: Update mask names throughout. (target_flags, ISIZE_BIT, DALIGN_BIT, SH1_BIT, SH2_BIT, SH3_BIT) (SH_E_BIT, HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, SH4A_BIT, FMOVD_BIT) (SH5_BIT, SPACE_BIT, BIGTABLE_BIT, RELAX_BIT, USERMODE_BIT) (HITACHI_BIT, NOMACSAVE_BIT, PREFERGOT_BIT, PADSTRUCT_BIT) (LITTLE_ENDIAN_BIT, IEEE_BIT, SAVE_ALL_TR_BIT, HARD_SH2A_BIT) (HARD_SH2A_DOUBLE_BIT, INDEXED_ADDRESS_BIT, PT_FIXED_BIT) (INVALID_SYMBOLS_BIT, ADJUST_UNROLL_BIT, TARGET_DUMPISIZE) (TARGET_ALIGN_DOUBLE, TARGET_SH1, TARGET_SH2, TARGET_SH3) (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH5, TARGET_FMOVD) (TARGET_IEEE, TARGET_SMALLCODE, TARGET_BIGTABLE, TARGET_RELAX) (TARGET_HITACHI, TARGET_NOMACSAVE, TARGET_PADSTRUCT) (TARGET_LITTLE_ENDIAN, TARGET_USERMODE, TARGET_PREFERGOT) (TARGET_SAVE_ALL_TARGET_REGS, TARGET_ALLOW_INDEXED_ADDRESS) (TARGET_PT_FIXED, TARGET_INVALID_SYMBOLS, TARGET_ADJUST_UNROLL) (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E) (TARGET_SWITCH_SH2A, TARGET_SWITCH_SH2A_SINGLE_ONLY) (TARGET_SWITCH_SH2A_SINGLE, TARGET_SWITCH_SH2A_NOFPU) (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E, TARGET_SWITCH_SH4_SINGLE_ONLY) (TARGET_SWITCH_SH4_SINGLE, TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4) (TARGET_SWITCH_SH4A, TARGET_SWITCH_SH4A_SINGLE_ONLY) (TARGET_SWITCH_SH4A_SINGLE, TARGET_SWITCH_SH4A_NOFPU) (TARGET_SWITCH_SH4AL, TARGET_SWITCH_SH5_64MEDIA) (TARGET_SWITCH_SH5_64MEDIA_NOFPU, TARGET_SWITCHES_SH5_32MEDIA) (TARGET_SWITCHES_SH5_32MEDIA_NOFPU, TARGET_SWITCH_SH5_32_ANY_EXTRA) (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA, TARGET_SWITCHES) (SUBTARGET_SWITCHES): Delete. (TARGET_SH2E, TARGET_SH2A, TARGET_SH2A_SINGLE, TARGET_SH2A_DOUBLE) (TARGET_SH3E, TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARVARD) (TARGET_FPU_DOUBLE, TARGET_SH4A_ARCH, TARGET_SHMEDIA32) (TARGET_SHMEDIA64): Redefine using other TARGET_* macros. (TARGET_SH4): Undefine options.h definition and check MASK_SH1 as well. (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4, SUPPORT_SH4_SINGLE) (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Make numeric. (SUPPORT_SH2): Define to 1 if SUPPORT_SH1. (SUPPORT_SH3): Likewise SUPPORT_SH2. (SUPPORT_SH4_NOFPU): Likewise SUPPORT_SH3. (SUPPORT_SH4A_NOFPU, SUPPORT_SH4AL, SUPPORT_SH2A_NOFPU): Likewise SUPPORT_SH4_NOFPU. (SUPPORT_SH3E): Likewise SUPPORT_SH2E. (SUPPORT_SH4_SINGLE_ONLY, SUPPORT_SH4A_SINGLE_ONLY) (SUPPORT_SH2A_SINGLE_ONLY): Likewise SUPPORT_SH3E. (SUPPORT_SH4A): Likewise SUPPORT_SH4. (SUPPORT_SH4A_SINGLE): Likewise SUPPORT_SH4_SINGLE. (SUPPORT_SH5_32MEDIA): Likewise SUPPORT_SH5_COMPACT. (SUPPORT_SH5_32MEDIA_NOFPU): Likewise SUPPORT_SH5_COMPACT_NOFPU. (SUPPORT_ANY_SH5_32MEDIA, SUPPORT_ANY_SH5_64MEDIA) (SUPPORT_ANY_SH5): New macros. (TARGET_NONE): Replace with... (MASK_ARCH): ...this new macro. * config/sh/elf.h: Update mask names * config/sh/linux.h: Likewise. * config/sh/little.h: Likewise. * config/sh/netbsd-elf.h: Likewise. * config/sh/symbian-pre.h: Likewise. * config/sh/sh.c (sh_handle_option): New function. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. (calc_live_regs): Use MASK_FPU_SINGLE instead of FPU_SINGLE_BIT. (sh_target_switches, target_switches): Delete. (sh_pch_valid_p): Check for specific differences in the target_flags settings. (sh_init_cumulative_args): Use MASK_HITACHI instead of HITACHI_BIT. * config/sh/sh.opt: New file. From-SVN: r99916
2005-05-18 20:43:53 +02:00
target_flags &= ~MASK_FPU_SINGLE;
}
}
1995-04-21 03:19:27 +02:00
}
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
if (nosave_low_regs && reg == R8_REG)
break;
1995-04-21 03:19:27 +02:00
}
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
/* If we have a target register optimization pass after prologue / epilogue
threading, we need to assume all target registers will be live even if
they aren't now. */
if (flag_branch_target_load_optimize2
&& TARGET_SAVE_ALL_TARGET_REGS
&& shmedia_space_reserved_for_target_registers)
for (reg = LAST_TARGET_REG; reg >= FIRST_TARGET_REG; reg--)
if ((! call_really_used_regs[reg] || interrupt_handler)
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
&& ! TEST_HARD_REG_BIT (*live_regs_mask, reg))
{
SET_HARD_REG_BIT (*live_regs_mask, reg);
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
/* If this is an interrupt handler, we don't have any call-clobbered
registers we can conveniently use for target register save/restore.
Make sure we save at least one general purpose register when we need
to save target registers. */
if (interrupt_handler
&& hard_reg_set_intersect_p (*live_regs_mask,
reg_class_contents[TARGET_REGS])
&& ! hard_reg_set_intersect_p (*live_regs_mask,
reg_class_contents[GENERAL_REGS]))
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
{
SET_HARD_REG_BIT (*live_regs_mask, R0_REG);
count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (R0_REG));
}
1995-04-21 03:19:27 +02:00
return count;
1995-04-21 03:19:27 +02:00
}
/* Code to generate prologue and epilogue sequences */
1993-06-29 02:10:35 +02:00
/* PUSHED is the number of bytes that are being pushed on the
stack for register saves. Return the frame size, padded
appropriately so that the stack stays properly aligned. */
static HOST_WIDE_INT
rounded_frame_size (int pushed)
{
HOST_WIDE_INT size = get_frame_size ();
HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT;
if (ACCUMULATE_OUTGOING_ARGS)
size += crtl->outgoing_args_size;
return ((size + pushed + align - 1) & -align) - pushed;
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* Choose a call-clobbered target-branch register that remains
unchanged along the whole function. We set it up as the return
value in the prologue. */
int
sh_media_register_for_return (void)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
int regno;
int tr0_used;
output.h: (current_function_is_leaf... * output.h: (current_function_is_leaf, current_function_sp_is_unchanging, current_function_uses_only_leaf_regs): Remove. * function.c (current_function_is_leaf, current_function_sp_is_unchanging, current_function_uses_only_leaf_regs): Remove. (rest_of_handle_check_leaf_regs): Set crtl->uses_only_leaf_regs instead of current_function_uses_only_leaf_regs. * function.h (struct rtl_data): New fields sp_is_unchanging, is_leaf, uses_only_leaf_regs. * resource.c (init_resource_info): Replace current_function_is_leaf, current_function_sp_is_unchanging, and current_function_uses_only_leaf_regs with new crtl fields. * sdbout.c (sdbout_symbol): Likewise. * df-core.c (rest_of_handle_df_initialize): Likewise. * ira.c (ira): Likewise. * final.c (final_start_function): Likewise. * reorg.c (fill_simple_delay_slots): Likewise. * regrename.c (check_new_reg_p): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. (notice_stack_pointer_modification): Likewise. * dbxout.c (dbxout_symbol): Likewise. (dbxout_parms): Likewise. * sel-sched.c (init_regs_for_mode): Likewise. * dwarf2out.c (dbx_reg_number): Likewise. (multiple_reg_loc_descriptor): Likewise. * config/i386/i386.c (ix86_frame_pointer_required): Likewise. (gen_pop): Likewise. (ix86_select_alt_pic_regnum): Likewise. (ix86_compute_frame_layout): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (ix86_expand_epilogue): Likewise. * config/rs6000/rs6000.c (rs6000_stack_info): Likewise. * config/h8300/h8300.c (byte_reg): Likewise. * config/c6x/c6x.c (must_reload_pic_reg_p): Likewise. (c6x_save_reg): Likewise. (c6x_compute_frame_layout): Likewise. * config/pa/pa.c (pa_compute_frame_size): Likewise. (pa_output_function_prologue): Likewise. * config/stormy16/stormy16.c (struct xstormy16_stack_layout): Likewise. * config/sparc/sparc.md (attr "leaf_function"): Likewise. * config/sparc/sparc.c (sparc_initial_elimination_offset): Likewise. (sparc_expand_prologue): Likewise. (sparc_flat_expand_prologue): Likewise. (sparc_asm_function_prologue): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. * config/epiphany/epiphany.c (epiphany_compute_function_type): Likewise. (epiphany_compute_frame_size): Likewise. * config/lm32/lm32.c (lm32_compute_frame_size): Likewise. * config/cris/cris.c (cris_md_asm_clobbers): Likewise. (cris_frame_pointer_required): Likewise. * config/tilepro/tilepro.c (emit_sp_adjust): Likewise. (tilepro_current_function_is_leaf): Likewise. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/ia64/ia64.c (find_gr_spill): Likewise. (ia64_compute_frame_size): Likewise. (ia64_can_eliminate): Likewise. (ia64_initial_elimination_offset): Likewise. * config/m68k/m68k.c (m68k_save_reg): Likewise. (m68k_expand_epilogue): Likewise. * config/rx/rx.c (rx_get_stack_layout): Likewise. * config/tilegx/tilegx.c (tilegx_current_function_is_leaf): Likewise. * config/picochip/picochip.c (picochip_can_eliminate_link_sp_save): Likewise. (picochip_output_frame_debug): Likewise. * config/sh/sh.c (sh_media_register_for_return): Likewise. (sh_allocate_initial_value): Likewise. (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_must_save_register): Likewise. (compute_frame_size): Likewise. (microblaze_initial_elimination_offset): Likewise. (microblaze_expand_prologue): Likewise. (microblaze_expand_epilogue): Likewise. * config/frv/frv.c (frv_expand_epilogue): Likewise. (frv_frame_pointer_required): Likewise. * config/spu/spu.c (get_pic_reg): Likewise. (direct_return): Likewise. (spu_expand_prologue): Likewise. (spu_expand_epilogue): Likewise. (spu_initial_elimination_offset): Likewise. * config/mips/mips.c (mips_global_pointer): Likewise. (mips_cfun_might_clobber_call_saved_reg_p): Likewise. (mips_compute_frame_info): Likewise. * config/mep/mep.c (mep_interrupt_saved_reg): Likewise. (mep_reload_pointer): Likewise. * config/rl78/rl78.c (need_to_save): Likewise. * config/cr16/cr16.c (cr16_compute_save_regs): Likewise. * config/score/score.c (score_compute_frame_size): Likewise. (score_function_prologue): Likewise. * config/bfin/bfin.c (must_save_p): Likewise. (expand_prologue_reg_save): Likewise. (expand_epilogue_reg_restore): Likewise. (bfin_frame_pointer_required): Likewise. (n_regs_saved_by_prologue): Likewise. (add_to_reg): Likewise. (expand_interrupt_handler_prologue): Likewise. (expand_interrupt_handler_epilogue): Likewise. (bfin_expand_prologue): Likewise. * config/avr/avr.c (avr_regs_to_save): Likewise. (avr_prologue_setup_frame): Likewise. (expand_epilogue): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. (s390_register_info): Likewise. (s390_frame_info): Likewise. (s390_init_frame_layout): Likewise. (s390_emit_prologue): Likewise. From-SVN: r188918
2012-06-24 19:58:46 +02:00
if (! crtl->is_leaf)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return -1;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (lookup_attribute ("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl)))
return -1;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (sh_cfun_interrupt_handler_p ())
return -1;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
tr0_used = flag_pic && df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
for (regno = FIRST_TARGET_REG + tr0_used; regno <= LAST_TARGET_REG; regno++)
if (call_really_used_regs[regno] && ! df_regs_ever_live_p (regno))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return regno;
return -1;
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
/* The maximum registers we need to save are:
- 62 general purpose registers (r15 is stack pointer, r63 is zero)
- 32 floating point registers (for each pair, we save none,
one single precision value, or a double precision value).
- 8 target registers
- add 1 entry for a delimiter. */
#define MAX_SAVED_REGS (62+32+8)
typedef struct save_entry_s
{
unsigned char reg;
unsigned char mode;
short offset;
} save_entry;
#define MAX_TEMPS 4
/* There will be a delimiter entry with VOIDmode both at the start and the
end of a filled in schedule. The end delimiter has the offset of the
save with the smallest (i.e. most negative) offset. */
typedef struct save_schedule_s
{
save_entry entries[MAX_SAVED_REGS + 2];
int temps[MAX_TEMPS+1];
} save_schedule;
/* Fill in SCHEDULE according to LIVE_REGS_MASK. If RESTORE is nonzero,
use reverse order. Returns the last entry written to (not counting
the delimiter). OFFSET_BASE is a number to be added to all offset
entries. */
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
static save_entry *
sh5_schedule_saves (HARD_REG_SET *live_regs_mask, save_schedule *schedule,
int offset_base)
{
int align, i;
save_entry *entry = schedule->entries;
int tmpx = 0;
int offset;
if (! current_function_interrupt)
for (i = FIRST_GENERAL_REG; tmpx < MAX_TEMPS && i <= LAST_GENERAL_REG; i++)
if (call_really_used_regs[i] && ! fixed_regs[i] && i != PR_MEDIA_REG
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
&& ! FUNCTION_ARG_REGNO_P (i)
&& i != FIRST_RET_REG
&& ! (cfun->static_chain_decl != NULL && i == STATIC_CHAIN_REGNUM)
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->calls_eh_return
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
&& (i == EH_RETURN_STACKADJ_REGNO
|| ((unsigned) i >= EH_RETURN_DATA_REGNO (0)
&& (unsigned) i <= EH_RETURN_DATA_REGNO (3)))))
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
schedule->temps[tmpx++] = i;
entry->reg = -1;
entry->mode = VOIDmode;
entry->offset = offset_base;
entry++;
/* We loop twice: first, we save 8-byte aligned registers in the
higher addresses, that are known to be aligned. Then, we
proceed to saving 32-bit registers that don't need 8-byte
alignment.
If this is an interrupt function, all registers that need saving
need to be saved in full. moreover, we need to postpone saving
target registers till we have saved some general purpose registers
we can then use as scratch registers. */
offset = offset_base;
for (align = 1; align >= 0; align--)
{
for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
if (TEST_HARD_REG_BIT (*live_regs_mask, i))
{
enum machine_mode mode = REGISTER_NATURAL_MODE (i);
int reg = i;
if (current_function_interrupt)
{
if (TARGET_REGISTER_P (i))
continue;
if (GENERAL_REGISTER_P (i))
mode = DImode;
}
if (mode == SFmode && (i % 2) == 1
&& ! TARGET_FPU_SINGLE && FP_REGISTER_P (i)
&& (TEST_HARD_REG_BIT (*live_regs_mask, (i ^ 1))))
{
mode = DFmode;
i--;
reg--;
}
/* If we're doing the aligned pass and this is not aligned,
or we're doing the unaligned pass and this is aligned,
skip it. */
if ((GET_MODE_SIZE (mode) % (STACK_BOUNDARY / BITS_PER_UNIT) == 0)
!= align)
continue;
if (current_function_interrupt
&& GENERAL_REGISTER_P (i)
&& tmpx < MAX_TEMPS)
schedule->temps[tmpx++] = i;
offset -= GET_MODE_SIZE (mode);
entry->reg = i;
entry->mode = mode;
entry->offset = offset;
entry++;
}
if (align && current_function_interrupt)
for (i = LAST_TARGET_REG; i >= FIRST_TARGET_REG; i--)
if (TEST_HARD_REG_BIT (*live_regs_mask, i))
{
offset -= GET_MODE_SIZE (DImode);
entry->reg = i;
entry->mode = DImode;
entry->offset = offset;
entry++;
}
}
entry->reg = -1;
entry->mode = VOIDmode;
entry->offset = offset;
schedule->temps[tmpx] = -1;
return entry - 1;
}
1993-06-29 02:10:35 +02:00
void
sh_expand_prologue (void)
1993-06-29 02:10:35 +02:00
{
HARD_REG_SET live_regs_mask;
int d, i;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
int d_rounding = 0;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
int save_flags = target_flags;
int pretend_args;
int stack_usage;
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
tree sp_switch_attr
= lookup_attribute ("sp_switch", DECL_ATTRIBUTES (current_function_decl));
1993-06-29 02:10:35 +02:00
current_function_interrupt = sh_cfun_interrupt_handler_p ();
/* We have pretend args if we had an object sent partially in registers
1995-04-21 03:19:27 +02:00
and partially on the stack, e.g. a large structure. */
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 = crtl->args.pretend_args_size;
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl)
&& (NPARM_REGS(SImode)
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->args.info.arg_count[(int) SH_ARG_INT]))
pretend_args = 0;
output_stack_adjust (-pretend_args
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->args.info.stack_regs * 8,
stack_pointer_rtx, 0, NULL, true);
stack_usage = pretend_args + crtl->args.info.stack_regs * 8;
1993-06-29 02:10:35 +02:00
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
if (TARGET_SHCOMPACT && flag_pic && crtl->args.info.call_cookie)
/* We're going to use the PIC register to load the address of the
incoming-argument decoder and/or of the return trampoline from
the GOT, so make sure the PIC register is preserved and
initialized. */
df_set_regs_ever_live (PIC_OFFSET_TABLE_REGNUM, true);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHCOMPACT
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->args.info.call_cookie & ~ CALL_COOKIE_RET_TRAMP(1)))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
int reg;
/* First, make all registers with incoming arguments that will
be pushed onto the stack live, so that register renaming
doesn't overwrite them. */
for (reg = 0; reg < NPARM_REGS (SImode); reg++)
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
if (CALL_COOKIE_STACKSEQ_GET (crtl->args.info.call_cookie)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
>= NPARM_REGS (SImode) - reg)
for (; reg < NPARM_REGS (SImode); reg++)
emit_insn (gen_shcompact_preserve_incoming_args
(gen_rtx_REG (SImode, FIRST_PARM_REG + reg)));
else if (CALL_COOKIE_INT_REG_GET
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->args.info.call_cookie, reg) == 1)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
emit_insn (gen_shcompact_preserve_incoming_args
(gen_rtx_REG (SImode, FIRST_PARM_REG + reg)));
emit_move_insn (gen_rtx_REG (Pmode, MACL_REG),
stack_pointer_rtx);
emit_move_insn (gen_rtx_REG (SImode, R0_REG),
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
GEN_INT (crtl->args.info.call_cookie));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
emit_move_insn (gen_rtx_REG (SImode, MACH_REG),
gen_rtx_REG (SImode, R0_REG));
}
else if (TARGET_SHMEDIA)
{
int tr = sh_media_register_for_return ();
if (tr >= 0)
emit_move_insn (gen_rtx_REG (DImode, tr),
gen_rtx_REG (DImode, PR_MEDIA_REG));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
/* Emit the code for SETUP_VARARGS. */
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 (cfun->stdarg)
1993-06-29 02:10:35 +02:00
{
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl))
{
/* Push arg regs as if they'd been provided by caller in stack. */
for (i = 0; i < NPARM_REGS(SImode); i++)
{
int rn = NPARM_REGS(SImode) + FIRST_PARM_REG - i - 1;
if (i >= (NPARM_REGS(SImode)
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->args.info.arg_count[(int) SH_ARG_INT]
))
break;
push (rn);
stack_usage += GET_MODE_SIZE (SImode);
}
}
1993-06-29 02:10:35 +02:00
}
/* If we're supposed to switch stacks at function entry, do so now. */
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
if (sp_switch_attr)
{
rtx lab, newsrc;
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
/* The argument specifies a variable holding the address of the
stack the interrupt function should switch to/from at entry/exit. */
tree arg = TREE_VALUE ( TREE_VALUE (sp_switch_attr));
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
const char *s
= ggc_strdup (TREE_STRING_POINTER (arg));
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
rtx sp_switch = gen_rtx_SYMBOL_REF (Pmode, s);
lab = add_constant (sp_switch, SImode, 0);
newsrc = gen_rtx_LABEL_REF (VOIDmode, lab);
newsrc = gen_const_mem (SImode, newsrc);
emit_insn (gen_sp_switch_1 (newsrc));
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
}
d = calc_live_regs (&live_regs_mask);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
/* ??? Maybe we could save some switching if we can move a mode switch
that already happens to be at the function start into the prologue. */
if (target_flags != save_flags && ! current_function_interrupt)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
emit_insn (gen_toggle_sz ());
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH5)
{
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
int offset_base, offset;
rtx r0 = NULL_RTX;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
int offset_in_r0 = -1;
int sp_in_r0 = 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
int tregs_space = shmedia_target_regs_stack_adjust (&live_regs_mask);
int total_size, save_size;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
save_schedule schedule;
save_entry *entry;
int *tmp_pnt;
if (call_really_used_regs[R0_REG] && ! fixed_regs[R0_REG]
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
&& ! current_function_interrupt)
r0 = gen_rtx_REG (Pmode, R0_REG);
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
/* D is the actual number of bytes that we need for saving registers,
however, in initial_elimination_offset we have committed to using
an additional TREGS_SPACE amount of bytes - in order to keep both
addresses to arguments supplied by the caller and local variables
valid, we must keep this gap. Place it between the incoming
arguments and the actually saved registers in a bid to optimize
locality of reference. */
total_size = d + tregs_space;
total_size += rounded_frame_size (total_size);
save_size = total_size - rounded_frame_size (d);
if (save_size % (STACK_BOUNDARY / BITS_PER_UNIT))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
d_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
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
- save_size % (STACK_BOUNDARY / BITS_PER_UNIT));
/* If adjusting the stack in a single step costs nothing extra, do so.
I.e. either if a single addi is enough, or we need a movi anyway,
and we don't exceed the maximum offset range (the test for the
latter is conservative for simplicity). */
if (TARGET_SHMEDIA
&& (CONST_OK_FOR_I10 (-total_size)
|| (! CONST_OK_FOR_I10 (-(save_size + d_rounding))
&& total_size <= 2044)))
d_rounding = total_size - save_size;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
offset_base = d + d_rounding;
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
output_stack_adjust (-(save_size + d_rounding), stack_pointer_rtx,
0, NULL, true);
stack_usage += save_size + d_rounding;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
sh5_schedule_saves (&live_regs_mask, &schedule, offset_base);
tmp_pnt = schedule.temps;
for (entry = &schedule.entries[1]; entry->mode != VOIDmode; entry++)
{
collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. ./: * collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. * dce.c (run_fast_df_dce): Change type of old_flags to int. * df-core.c (df_set_flags): Change return type to int. Change type of old_flags to int. (df_clear_flags): Likewise. * df-scan.c (df_def_record_1): Change 0 to VOIDmode. (df_get_conditional_uses): Likewise. * df.h (df_set_flags, df_clear_flags): Update declarations. * dwarf2out.c (struct indirect_string_node): Change type of form field to enum dwarf_form. (AT_string_form): Change return type to enum dwarf_form. * fixed-value.c (fixed_compare): Add cast to enum type. * fwprop.c (update_df): Change 0 to VOIDmode. * gensupport.c: Change 0 to UNKNOWN. * gimple.h (gimple_cond_code): Add cast to enum type. * haifa-sched.c (reemit_notes): Add cast to enum type. * hooks.c (hook_int_void_no_regs): Remove function. * hooks.h (hook_int_void_no_regs): Remove declaration. * optabs.c (expand_widen_pattern_expr): Change 0 to VOIDmode. * predict.c (combine_predictions_for_insn): Add casts to enum type. * real.c (real_arithmetic): Add cast to enum type. (real_compare): Likewise. * target.h (struct gcc_target): Change return type of branch_target_register_class to enum reg_class. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define as default_branch_target_register_class. * targhooks.c (default_branch_target_register_class): New function. * targhooks.h (default_branch_target_register_class): Declare. * tree-data-ref.c (print_direction_vector): Add cast to enum type. * tree-vect-data-refs.c (vect_supportable_dr_alignment): Remove cast to int. * tree-vect-loop.c (vect_create_epilog_for_reduction): Change 0 to ERROR_MARK. * tree-vect-slp.c (vect_build_slp_tree): Change 0 to vect_uninitialized_def. Change 0 to ERROR_MARK. * tree-vect-stmts.c (supportable_widening_operation): Don't initialize icode1 and icode2. * tree-vectorizer.h (enum vect_def_type): Add vect_uninitialized_def. * config/sol2-c.c (cmn_err_length_specs): Change 0 to FMT_LEN_none and to STD_C89. (cmn_err_flag_specs): Change 0 to STD_C89. (cmn_err_char_table): Likewise. * config/arm/arm.c (get_arm_condition_code): Change type of code to enum arm_cond_code. (IWMMXT_BUILTIN): Change 0 to UNKNOWN. (IWMMXT_BUILTIN2): Likewise. (neon_builtin_type_bits): Don't define typedef. (neon_builtin_datum): Change type of bits field to int. (arm_expand_neon_args): Add cast to enum type. * config/ia64/ia64.c (tls_symbolic_operand_type): Change 0 to TLS_MODEL_NONE. * config/i386/i386.c (bdesc_multi_arg): Change 0 to UNKNOWN. Add casts to enum type. * config/mips/mips.c (LOONGSON_BUILTIN_ALIAS): Change 0 to MIPS_FP_COND_f. * config/mips/mips.md (jal_macro): Return enum constant. (single_insn): Likewise. * config/rs6000/rs6000.c (bdesc_altivec_preds): Change 0 to CODE_FOR_nothing. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add casts to enum type. * config/s390/s390.c (s390_tune_flags): Change type to int. (s390_arch_flags): Likewise. (s390_handle_arch_option): Change flags field of struct pta to int. * config/s390/s390.h (s390_tune_flags): Update declaration. (s390_arch_flags): Likewise. * config/sh/sh.c (prepare_move_operands): Compare tls_symbolic_operand result with enum constant. (sh_reorg): Change PUT_MODE to PUT_REG_NOTE_KIND. (sh_expand_prologue): Add cast to enum type. (sh_expand_epilogue): Likewise. (tls_symbolic_operand): Change return type to enum tls_model. (fpscr_set_from_mem): Add cast to enum type. (legitimize_pic_address): Compare tls_symbolic_operand result with enum constant. (sh_target_reg_class): Change return type to enum reg_class. * config/sh/sh.h (OVERRIDE_OPTIONS): Change CPU_xxx to PROCESSOR_xxx. * config/sh/sh-protos.h (tls_symbolic_operand): Update declaration. * config/sparc/sparc.c (sparc_override_options): Add cast to enum type. * config/sparc/sparc.md (empty_delay_slot): Return enum constant. (pic, calls_alloca, calls_eh_return, leaf_function): Likewise. (delayed_branch, tls_call_delay): Likewise. (eligible_for_sibcall_delay): Likewise. (eligible_for_return_delay): Likewise. * config/spu/spu.c (expand_builtin_args): Add cast to enum type. (spu_expand_builtin_1): Likewise. * c-typeck.c (convert_for_assignment): Issue -Wc++-compat warnings for all types of conversions. (output_init_element): Issue -Wc++-compat warning if needed when initializing a bitfield with enum type. * c-parser.c (c_parser_expression): Set original_type to original_type of right hand operand of comman operator. cp/: * semantics.c (finish_omp_clauses): Change type of c_kind to enum omp_clause_code. fortran/: * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum type. * trans-io.c (st_parameter_field): Add casts to enum type. java/: * builtins.c (java_builtins): Add casts to enum type. * verify-impl.c (check_class_constant): Add cast to enum type. (check_constant, check_wide_constant): Likewise. objc/: * objc-act.c (objc_gimplify_expr): Add casts to enum type. testsuite/: * gcc.dg/Wcxx-compat-5.c: New testcase. * gcc.dg/Wcxx-compat-6.c: New testcase. From-SVN: r146855
2009-04-27 22:25:48 +02:00
enum machine_mode mode = (enum machine_mode) entry->mode;
unsigned int reg = entry->reg;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
rtx reg_rtx, mem_rtx, pre_dec = NULL_RTX;
rtx orig_reg_rtx;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
offset = entry->offset;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
reg_rtx = gen_rtx_REG (mode, reg);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
mem_rtx = gen_frame_mem (mode,
gen_rtx_PLUS (Pmode,
stack_pointer_rtx,
GEN_INT (offset)));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (!memory_address_p (mode, XEXP (mem_rtx, 0)))
{
gcc_assert (r0);
mem_rtx = NULL_RTX;
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (HAVE_PRE_DECREMENT
&& (offset_in_r0 - offset == GET_MODE_SIZE (mode)
|| mem_rtx == NULL_RTX
|| reg == PR_REG || SPECIAL_REGISTER_P (reg)))
{
pre_dec = gen_frame_mem (mode, gen_rtx_PRE_DEC (Pmode, r0));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (!memory_address_p (mode, XEXP (pre_dec, 0)))
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
pre_dec = NULL_RTX;
else
{
mem_rtx = NULL_RTX;
offset += GET_MODE_SIZE (mode);
}
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (mem_rtx != NULL_RTX)
goto addr_ok;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (offset_in_r0 == -1)
{
emit_move_insn (r0, GEN_INT (offset));
offset_in_r0 = offset;
}
else if (offset != offset_in_r0)
{
emit_move_insn (r0,
gen_rtx_PLUS
(Pmode, r0,
GEN_INT (offset - offset_in_r0)));
offset_in_r0 += offset - offset_in_r0;
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (pre_dec != NULL_RTX)
{
if (! sp_in_r0)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
emit_move_insn (r0,
gen_rtx_PLUS
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
(Pmode, r0, stack_pointer_rtx));
sp_in_r0 = 1;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
offset -= GET_MODE_SIZE (mode);
offset_in_r0 -= GET_MODE_SIZE (mode);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
mem_rtx = pre_dec;
}
else if (sp_in_r0)
mem_rtx = gen_frame_mem (mode, r0);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
else
mem_rtx = gen_frame_mem (mode,
gen_rtx_PLUS (Pmode,
stack_pointer_rtx,
r0));
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
/* We must not use an r0-based address for target-branch
registers or for special registers without pre-dec
memory addresses, since we store their values in r0
first. */
gcc_assert (!TARGET_REGISTER_P (reg)
&& ((reg != PR_REG && !SPECIAL_REGISTER_P (reg))
|| mem_rtx == pre_dec));
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
addr_ok:
orig_reg_rtx = reg_rtx;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (TARGET_REGISTER_P (reg)
|| ((reg == PR_REG || SPECIAL_REGISTER_P (reg))
&& mem_rtx != pre_dec))
{
rtx tmp_reg = gen_rtx_REG (GET_MODE (reg_rtx), *tmp_pnt);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
emit_move_insn (tmp_reg, reg_rtx);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (REGNO (tmp_reg) == R0_REG)
{
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
offset_in_r0 = -1;
sp_in_r0 = 0;
gcc_assert (!refers_to_regno_p
(R0_REG, R0_REG+1, mem_rtx, (rtx *) 0));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (*++tmp_pnt <= 0)
tmp_pnt = schedule.temps;
reg_rtx = tmp_reg;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
{
rtx insn;
/* Mark as interesting for dwarf cfi generator */
insn = emit_move_insn (mem_rtx, reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
/* If we use an intermediate register for the save, we can't
describe this exactly in cfi as a copy of the to-be-saved
register into the temporary register and then the temporary
register on the stack, because the temporary register can
have a different natural size than the to-be-saved register.
Thus, we gloss over the intermediate copy and pretend we do
a direct save from the to-be-saved register. */
if (REGNO (reg_rtx) != reg)
{
rtx set;
set = gen_rtx_SET (VOIDmode, mem_rtx, orig_reg_rtx);
add_reg_note (insn, REG_FRAME_RELATED_EXPR, set);
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (TARGET_SHCOMPACT && (offset_in_r0 != -1))
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
{
rtx reg_rtx = gen_rtx_REG (mode, reg);
rtx set;
rtx mem_rtx = gen_frame_mem (mode,
gen_rtx_PLUS (Pmode,
stack_pointer_rtx,
GEN_INT (offset)));
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
set = gen_rtx_SET (VOIDmode, mem_rtx, reg_rtx);
add_reg_note (insn, REG_FRAME_RELATED_EXPR, set);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
}
}
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
gcc_assert (entry->offset == d_rounding);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
else
{
push_regs (&live_regs_mask, current_function_interrupt);
stack_usage += d;
}
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
if (flag_pic && df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM))
emit_insn (gen_GOTaddr2picreg ());
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (SHMEDIA_REGS_STACK_ADJUST ())
{
/* This must NOT go through the PLT, otherwise mach and macl
may be clobbered. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (gen_rtx_REG (Pmode, R0_REG),
(TARGET_FPU_ANY
? "__GCC_push_shmedia_regs"
: "__GCC_push_shmedia_regs_nofpu"), SFUNC_GOT);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
emit_insn (gen_shmedia_save_restore_regs_compact
(GEN_INT (-SHMEDIA_REGS_STACK_ADJUST ())));
}
if (target_flags != save_flags && ! current_function_interrupt)
emit_insn (gen_toggle_sz ());
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
target_flags = save_flags;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
output_stack_adjust (-rounded_frame_size (d) + d_rounding,
stack_pointer_rtx, 0, NULL, true);
stack_usage += rounded_frame_size (d) - d_rounding;
1993-06-29 02:10:35 +02:00
if (frame_pointer_needed)
frame_insn (GEN_MOV (hard_frame_pointer_rtx, stack_pointer_rtx));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHCOMPACT
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->args.info.call_cookie & ~ CALL_COOKIE_RET_TRAMP(1)))
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
/* This must NOT go through the PLT, otherwise mach and macl
may be clobbered. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (gen_rtx_REG (Pmode, R0_REG),
"__GCC_shcompact_incoming_args", SFUNC_GOT);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
emit_insn (gen_shcompact_incoming_args ());
}
/* If we are profiling, make sure no instructions are scheduled before
the call to mcount. Similarly if some call instructions are swapped
before frame related insns, it'll confuse the unwinder because
currently SH has no unwind info for function epilogues. */
if (crtl->profile || flag_exceptions || flag_unwind_tables)
emit_insn (gen_blockage ());
if (flag_stack_usage_info)
current_function_static_stack_size = stack_usage;
1993-06-29 02:10:35 +02:00
}
void
sh_expand_epilogue (bool sibcall_p)
1993-06-29 02:10:35 +02:00
{
HARD_REG_SET live_regs_mask;
int d, i;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
int d_rounding = 0;
1993-06-29 02:10:35 +02:00
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
int save_flags = target_flags;
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
int frame_size, save_size;
int fpscr_deferred = 0;
int e = sibcall_p ? -1 : 1;
d = calc_live_regs (&live_regs_mask);
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
save_size = d;
frame_size = rounded_frame_size (d);
if (TARGET_SH5)
{
int tregs_space = shmedia_target_regs_stack_adjust (&live_regs_mask);
int total_size;
if (d % (STACK_BOUNDARY / BITS_PER_UNIT))
d_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
- d % (STACK_BOUNDARY / BITS_PER_UNIT));
total_size = d + tregs_space;
total_size += rounded_frame_size (total_size);
save_size = total_size - frame_size;
/* If adjusting the stack in a single step costs nothing extra, do so.
I.e. either if a single addi is enough, or we need a movi anyway,
and we don't exceed the maximum offset range (the test for the
latter is conservative for simplicity). */
if (TARGET_SHMEDIA
&& ! frame_pointer_needed
&& (CONST_OK_FOR_I10 (total_size)
|| (! CONST_OK_FOR_I10 (save_size + d_rounding)
&& total_size <= 2044)))
d_rounding = frame_size;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
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
frame_size -= d_rounding;
}
1993-06-29 02:10:35 +02:00
if (frame_pointer_needed)
{
/* We must avoid scheduling the epilogue with previous basic blocks.
See PR/18032 and PR/40313. */
emit_insn (gen_blockage ());
output_stack_adjust (frame_size, hard_frame_pointer_rtx, e,
&live_regs_mask, true);
/* We must avoid moving the stack pointer adjustment past code
which reads from the local frame, else an interrupt could
occur after the SP adjustment and clobber data in the local
frame. */
emit_insn (gen_blockage ());
frame_insn (GEN_MOV (stack_pointer_rtx, hard_frame_pointer_rtx));
}
else if (frame_size)
{
/* We must avoid moving the stack pointer adjustment past code
which reads from the local frame, else an interrupt could
occur after the SP adjustment and clobber data in the local
frame. */
emit_insn (gen_blockage ());
output_stack_adjust (frame_size, stack_pointer_rtx, e,
&live_regs_mask, true);
}
1993-06-29 02:10:35 +02:00
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (SHMEDIA_REGS_STACK_ADJUST ())
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (gen_rtx_REG (Pmode, R0_REG),
(TARGET_FPU_ANY
? "__GCC_pop_shmedia_regs"
: "__GCC_pop_shmedia_regs_nofpu"), SFUNC_GOT);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* This must NOT go through the PLT, otherwise mach and macl
may be clobbered. */
emit_insn (gen_shmedia_save_restore_regs_compact
(GEN_INT (SHMEDIA_REGS_STACK_ADJUST ())));
}
/* Pop all the registers. */
if (target_flags != save_flags && ! current_function_interrupt)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
emit_insn (gen_toggle_sz ());
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH5)
{
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
int offset_base, offset;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
int offset_in_r0 = -1;
int sp_in_r0 = 0;
rtx r0 = gen_rtx_REG (Pmode, R0_REG);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
save_schedule schedule;
save_entry *entry;
int *tmp_pnt;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
entry = sh5_schedule_saves (&live_regs_mask, &schedule, d_rounding);
offset_base = -entry[1].offset + d_rounding;
tmp_pnt = schedule.temps;
for (; entry->mode != VOIDmode; entry--)
{
collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. ./: * collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. * dce.c (run_fast_df_dce): Change type of old_flags to int. * df-core.c (df_set_flags): Change return type to int. Change type of old_flags to int. (df_clear_flags): Likewise. * df-scan.c (df_def_record_1): Change 0 to VOIDmode. (df_get_conditional_uses): Likewise. * df.h (df_set_flags, df_clear_flags): Update declarations. * dwarf2out.c (struct indirect_string_node): Change type of form field to enum dwarf_form. (AT_string_form): Change return type to enum dwarf_form. * fixed-value.c (fixed_compare): Add cast to enum type. * fwprop.c (update_df): Change 0 to VOIDmode. * gensupport.c: Change 0 to UNKNOWN. * gimple.h (gimple_cond_code): Add cast to enum type. * haifa-sched.c (reemit_notes): Add cast to enum type. * hooks.c (hook_int_void_no_regs): Remove function. * hooks.h (hook_int_void_no_regs): Remove declaration. * optabs.c (expand_widen_pattern_expr): Change 0 to VOIDmode. * predict.c (combine_predictions_for_insn): Add casts to enum type. * real.c (real_arithmetic): Add cast to enum type. (real_compare): Likewise. * target.h (struct gcc_target): Change return type of branch_target_register_class to enum reg_class. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define as default_branch_target_register_class. * targhooks.c (default_branch_target_register_class): New function. * targhooks.h (default_branch_target_register_class): Declare. * tree-data-ref.c (print_direction_vector): Add cast to enum type. * tree-vect-data-refs.c (vect_supportable_dr_alignment): Remove cast to int. * tree-vect-loop.c (vect_create_epilog_for_reduction): Change 0 to ERROR_MARK. * tree-vect-slp.c (vect_build_slp_tree): Change 0 to vect_uninitialized_def. Change 0 to ERROR_MARK. * tree-vect-stmts.c (supportable_widening_operation): Don't initialize icode1 and icode2. * tree-vectorizer.h (enum vect_def_type): Add vect_uninitialized_def. * config/sol2-c.c (cmn_err_length_specs): Change 0 to FMT_LEN_none and to STD_C89. (cmn_err_flag_specs): Change 0 to STD_C89. (cmn_err_char_table): Likewise. * config/arm/arm.c (get_arm_condition_code): Change type of code to enum arm_cond_code. (IWMMXT_BUILTIN): Change 0 to UNKNOWN. (IWMMXT_BUILTIN2): Likewise. (neon_builtin_type_bits): Don't define typedef. (neon_builtin_datum): Change type of bits field to int. (arm_expand_neon_args): Add cast to enum type. * config/ia64/ia64.c (tls_symbolic_operand_type): Change 0 to TLS_MODEL_NONE. * config/i386/i386.c (bdesc_multi_arg): Change 0 to UNKNOWN. Add casts to enum type. * config/mips/mips.c (LOONGSON_BUILTIN_ALIAS): Change 0 to MIPS_FP_COND_f. * config/mips/mips.md (jal_macro): Return enum constant. (single_insn): Likewise. * config/rs6000/rs6000.c (bdesc_altivec_preds): Change 0 to CODE_FOR_nothing. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add casts to enum type. * config/s390/s390.c (s390_tune_flags): Change type to int. (s390_arch_flags): Likewise. (s390_handle_arch_option): Change flags field of struct pta to int. * config/s390/s390.h (s390_tune_flags): Update declaration. (s390_arch_flags): Likewise. * config/sh/sh.c (prepare_move_operands): Compare tls_symbolic_operand result with enum constant. (sh_reorg): Change PUT_MODE to PUT_REG_NOTE_KIND. (sh_expand_prologue): Add cast to enum type. (sh_expand_epilogue): Likewise. (tls_symbolic_operand): Change return type to enum tls_model. (fpscr_set_from_mem): Add cast to enum type. (legitimize_pic_address): Compare tls_symbolic_operand result with enum constant. (sh_target_reg_class): Change return type to enum reg_class. * config/sh/sh.h (OVERRIDE_OPTIONS): Change CPU_xxx to PROCESSOR_xxx. * config/sh/sh-protos.h (tls_symbolic_operand): Update declaration. * config/sparc/sparc.c (sparc_override_options): Add cast to enum type. * config/sparc/sparc.md (empty_delay_slot): Return enum constant. (pic, calls_alloca, calls_eh_return, leaf_function): Likewise. (delayed_branch, tls_call_delay): Likewise. (eligible_for_sibcall_delay): Likewise. (eligible_for_return_delay): Likewise. * config/spu/spu.c (expand_builtin_args): Add cast to enum type. (spu_expand_builtin_1): Likewise. * c-typeck.c (convert_for_assignment): Issue -Wc++-compat warnings for all types of conversions. (output_init_element): Issue -Wc++-compat warning if needed when initializing a bitfield with enum type. * c-parser.c (c_parser_expression): Set original_type to original_type of right hand operand of comman operator. cp/: * semantics.c (finish_omp_clauses): Change type of c_kind to enum omp_clause_code. fortran/: * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum type. * trans-io.c (st_parameter_field): Add casts to enum type. java/: * builtins.c (java_builtins): Add casts to enum type. * verify-impl.c (check_class_constant): Add cast to enum type. (check_constant, check_wide_constant): Likewise. objc/: * objc-act.c (objc_gimplify_expr): Add casts to enum type. testsuite/: * gcc.dg/Wcxx-compat-5.c: New testcase. * gcc.dg/Wcxx-compat-6.c: New testcase. From-SVN: r146855
2009-04-27 22:25:48 +02:00
enum machine_mode mode = (enum machine_mode) entry->mode;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
int reg = entry->reg;
rtx reg_rtx, mem_rtx, post_inc = NULL_RTX;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
offset = offset_base + entry->offset;
reg_rtx = gen_rtx_REG (mode, reg);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
mem_rtx = gen_frame_mem (mode,
gen_rtx_PLUS (Pmode,
stack_pointer_rtx,
GEN_INT (offset)));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (!memory_address_p (mode, XEXP (mem_rtx, 0)))
mem_rtx = NULL_RTX;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (HAVE_POST_INCREMENT
&& (offset == offset_in_r0
|| (offset + GET_MODE_SIZE (mode) != d + d_rounding
&& mem_rtx == NULL_RTX)
|| reg == PR_REG || SPECIAL_REGISTER_P (reg)))
{
post_inc = gen_frame_mem (mode, gen_rtx_POST_INC (Pmode, r0));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (!memory_address_p (mode, XEXP (post_inc, 0)))
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
post_inc = NULL_RTX;
else
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
mem_rtx = NULL_RTX;
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (mem_rtx != NULL_RTX)
goto addr_ok;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (offset_in_r0 == -1)
{
emit_move_insn (r0, GEN_INT (offset));
offset_in_r0 = offset;
}
else if (offset != offset_in_r0)
{
emit_move_insn (r0,
gen_rtx_PLUS
(Pmode, r0,
GEN_INT (offset - offset_in_r0)));
offset_in_r0 += offset - offset_in_r0;
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
if (post_inc != NULL_RTX)
{
if (! sp_in_r0)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
emit_move_insn (r0,
gen_rtx_PLUS
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
(Pmode, r0, stack_pointer_rtx));
sp_in_r0 = 1;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
mem_rtx = post_inc;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
offset_in_r0 += GET_MODE_SIZE (mode);
}
else if (sp_in_r0)
mem_rtx = gen_frame_mem (mode, r0);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
else
mem_rtx = gen_frame_mem (mode,
gen_rtx_PLUS (Pmode,
stack_pointer_rtx,
r0));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
gcc_assert ((reg != PR_REG && !SPECIAL_REGISTER_P (reg))
|| mem_rtx == post_inc);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
addr_ok:
if ((reg == PR_REG || SPECIAL_REGISTER_P (reg))
&& mem_rtx != post_inc)
{
emit_move_insn (r0, mem_rtx);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
mem_rtx = r0;
}
else if (TARGET_REGISTER_P (reg))
{
rtx tmp_reg = gen_rtx_REG (mode, *tmp_pnt);
/* Give the scheduler a bit of freedom by using up to
MAX_TEMPS registers in a round-robin fashion. */
emit_move_insn (tmp_reg, mem_rtx);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
mem_rtx = tmp_reg;
if (*++tmp_pnt < 0)
tmp_pnt = schedule.temps;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
emit_move_insn (reg_rtx, mem_rtx);
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
}
gcc_assert (entry->offset + offset_base == d + d_rounding);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
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
else /* ! TARGET_SH5 */
1993-06-29 02:10:35 +02:00
{
int last_reg;
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
save_size = 0;
/* For an ISR with RESBANK attribute assigned, don't pop PR
register. */
if (TEST_HARD_REG_BIT (live_regs_mask, PR_REG)
&& !sh_cfun_resbank_handler_p ())
{
if (!frame_pointer_needed)
emit_insn (gen_blockage ());
pop (PR_REG);
}
/* Banked registers are popped first to avoid being scheduled in the
delay slot. RTE switches banks before the ds instruction. */
if (current_function_interrupt)
{
bool use_movml = false;
if (TARGET_SH2A)
{
unsigned int count = 0;
for (i = FIRST_BANKED_REG; i <= LAST_BANKED_REG; i++)
if (TEST_HARD_REG_BIT (live_regs_mask, i))
count++;
else
break;
/* Use movml when all banked register are poped. */
if (count == LAST_BANKED_REG - FIRST_BANKED_REG + 1)
use_movml = true;
}
if (sh_cfun_resbank_handler_p ())
; /* Do nothing. */
else if (use_movml)
{
rtx sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM);
/* We must avoid scheduling multiple load insn with another
insns. */
emit_insn (gen_blockage ());
emit_insn (gen_movml_pop_banked (sp_reg));
emit_insn (gen_blockage ());
}
else
for (i = LAST_BANKED_REG; i >= FIRST_BANKED_REG; i--)
if (TEST_HARD_REG_BIT (live_regs_mask, i))
pop (i);
last_reg = FIRST_PSEUDO_REGISTER - LAST_BANKED_REG - 1;
}
else
last_reg = FIRST_PSEUDO_REGISTER;
for (i = 0; i < last_reg; i++)
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
{
int j = (FIRST_PSEUDO_REGISTER - 1) - i;
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
if (j == FPSCR_REG && current_function_interrupt && TARGET_FMOVD
&& hard_reg_set_intersect_p (live_regs_mask,
reg_class_contents[DF_REGS]))
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
fpscr_deferred = 1;
/* For an ISR with RESBANK attribute assigned, don't pop
following registers, R0-R14, MACH, MACL and GBR. */
else if (j != PR_REG && TEST_HARD_REG_BIT (live_regs_mask, j)
&& ! (sh_cfun_resbank_handler_p ()
&& ((j >= FIRST_GENERAL_REG
&& j < LAST_GENERAL_REG)
|| j == MACH_REG
|| j == MACL_REG
|| j == GBR_REG)))
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
pop (j);
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
if (j == FIRST_FP_REG && fpscr_deferred)
pop (FPSCR_REG);
}
1993-06-29 02:10:35 +02:00
}
if (target_flags != save_flags && ! current_function_interrupt)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
emit_insn (gen_toggle_sz ());
target_flags = save_flags;
1993-06-29 02:10:35 +02:00
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
output_stack_adjust (crtl->args.pretend_args_size
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
+ save_size + d_rounding
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->args.info.stack_regs * 8,
stack_pointer_rtx, e, NULL, true);
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->calls_eh_return)
emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
/* Switch back to the normal stack if necessary. */
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
if (lookup_attribute ("sp_switch", DECL_ATTRIBUTES (current_function_decl)))
emit_insn (gen_sp_switch_2 ());
/* Tell flow the insn that pops PR isn't dead. */
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* PR_REG will never be live in SHmedia mode, and we don't need to
USE PR_MEDIA_REG, since it will be explicitly copied to TR0_REG
by the return pattern. */
if (TEST_HARD_REG_BIT (live_regs_mask, PR_REG))
rtl.h (emit_clobber, [...]): Declare. gcc/ * rtl.h (emit_clobber, gen_clobber, emit_use, gen_use): Declare. * emit-rtl.c (emit_clobber, gen_clobber, emit_use, gen_use): New functions. Do not emit uses and clobbers of CONCATs; individually use and clobber their operands. * builtins.c (expand_builtin_setjmp_receiver): Use emit_clobber, gen_clobber, emit_use and gen_use. (expand_builtin_longjmp, expand_builtin_nonlocal_goto): Likewise. (expand_builtin_return): Likewise. * cfgbuild.c (count_basic_blocks): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * explow.c (emit_stack_restore): Likewise. * expmed.c (extract_bit_field_1): Likewise. * expr.c (convert_move, emit_move_complex_parts): Likewise. (emit_move_multi_word, store_constructor): Likewise. * function.c (do_clobber_return_reg, do_use_return_reg): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * optabs.c (widen_operand, expand_binop): Likewise. (expand_doubleword_bswap, emit_no_conflict_block): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (eliminate_regs_in_insn): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * config/alpha/alpha.md (builtin_longjmp): Likewise. * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. * config/arm/arm.c (arm_load_pic_register): Likewise. (thumb1_expand_epilogue, thumb_set_return_address): Likewise. * config/arm/arm.md (untyped_return): Likewise. * config/arm/linux-elf.h (PROFILE_HOOK): Likewise. * config/avr/avr.c (expand_prologue): Likewise. * config/bfin/bfin.c (do_unlink): Likewise. * config/bfin/bfin.md (<optab>di3, adddi3, subdi3): Likewise. * config/cris/cris.c (cris_expand_prologue): Likewise. * config/darwin.c (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/frv/frv.c (frv_frame_access, frv_expand_epilogue): Likewise. (frv_ifcvt_modify_insn, frv_expand_mdpackh_builtin): Likewise. * config/i386/i386.c (ix86_expand_vector_move_misalign): Likewise. (ix86_expand_convert_uns_didf_sse): Likewise. (ix86_expand_vector_init_general): Likewise. * config/ia64/ia64.md (eh_epilogue): Likewise. * config/iq2000/iq2000.c (iq2000_expand_epilogue): Likewise. * config/m32c/m32c.c (m32c_emit_eh_epilogue): Likewise. * config/m32r/m32r.c (m32r_reload_lr): Likewise. (config/iq2000/iq2000.c): Likewise. * config/mips/mips.md (fixuns_truncdfsi2): Likewise. (fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise. (builtin_longjmp): Likewise. * config/mn10300/mn10300.md (call, call_value): Likewise. * config/pa/pa.md (nonlocal_goto, nonlocal_longjmp): Likewise. * config/pdp11/pdp11.md (abshi2): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. * config/s390/s390.c (s390_emit_prologue): Likewise. * config/s390/s390.md (movmem_long, setmem_long): Likewise. (cmpmem_long, extendsidi2, zero_extendsidi2, udivmoddi4): Likewise. (builtin_setjmp_receiver, restore_stack_nonlocal): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (output_stack_adjust, sh_expand_epilogue): Likewise. (sh_set_return_address, sh_expand_t_scc): Likewise. * config/sparc/sparc.c (load_pic_register): Likewise. * config/sparc/sparc.md (untyped_return, nonlocal_goto): Likewise. * config/spu/spu.c (spu_expand_epilogue): Likewise. * config/v850/v850.c (expand_epilogue): Likewise. From-SVN: r136251
2008-06-01 11:47:28 +02:00
emit_use (gen_rtx_REG (SImode, PR_REG));
1993-06-29 02:10:35 +02:00
}
/* Emit code to change the current function's return address to RA.
TEMP is available as a scratch register, if needed. */
void
sh_set_return_address (rtx ra, rtx tmp)
{
HARD_REG_SET live_regs_mask;
int d;
int pr_reg = TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG;
int pr_offset;
d = calc_live_regs (&live_regs_mask);
/* If pr_reg isn't life, we can set it (or the register given in
sh_media_register_for_return) directly. */
if (! TEST_HARD_REG_BIT (live_regs_mask, pr_reg))
{
rtx rr;
if (TARGET_SHMEDIA)
{
int rr_regno = sh_media_register_for_return ();
if (rr_regno < 0)
rr_regno = pr_reg;
rr = gen_rtx_REG (DImode, rr_regno);
}
else
rr = gen_rtx_REG (SImode, pr_reg);
emit_insn (GEN_MOV (rr, ra));
/* Tell flow the register for return isn't dead. */
rtl.h (emit_clobber, [...]): Declare. gcc/ * rtl.h (emit_clobber, gen_clobber, emit_use, gen_use): Declare. * emit-rtl.c (emit_clobber, gen_clobber, emit_use, gen_use): New functions. Do not emit uses and clobbers of CONCATs; individually use and clobber their operands. * builtins.c (expand_builtin_setjmp_receiver): Use emit_clobber, gen_clobber, emit_use and gen_use. (expand_builtin_longjmp, expand_builtin_nonlocal_goto): Likewise. (expand_builtin_return): Likewise. * cfgbuild.c (count_basic_blocks): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * explow.c (emit_stack_restore): Likewise. * expmed.c (extract_bit_field_1): Likewise. * expr.c (convert_move, emit_move_complex_parts): Likewise. (emit_move_multi_word, store_constructor): Likewise. * function.c (do_clobber_return_reg, do_use_return_reg): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * optabs.c (widen_operand, expand_binop): Likewise. (expand_doubleword_bswap, emit_no_conflict_block): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (eliminate_regs_in_insn): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * config/alpha/alpha.md (builtin_longjmp): Likewise. * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. * config/arm/arm.c (arm_load_pic_register): Likewise. (thumb1_expand_epilogue, thumb_set_return_address): Likewise. * config/arm/arm.md (untyped_return): Likewise. * config/arm/linux-elf.h (PROFILE_HOOK): Likewise. * config/avr/avr.c (expand_prologue): Likewise. * config/bfin/bfin.c (do_unlink): Likewise. * config/bfin/bfin.md (<optab>di3, adddi3, subdi3): Likewise. * config/cris/cris.c (cris_expand_prologue): Likewise. * config/darwin.c (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/frv/frv.c (frv_frame_access, frv_expand_epilogue): Likewise. (frv_ifcvt_modify_insn, frv_expand_mdpackh_builtin): Likewise. * config/i386/i386.c (ix86_expand_vector_move_misalign): Likewise. (ix86_expand_convert_uns_didf_sse): Likewise. (ix86_expand_vector_init_general): Likewise. * config/ia64/ia64.md (eh_epilogue): Likewise. * config/iq2000/iq2000.c (iq2000_expand_epilogue): Likewise. * config/m32c/m32c.c (m32c_emit_eh_epilogue): Likewise. * config/m32r/m32r.c (m32r_reload_lr): Likewise. (config/iq2000/iq2000.c): Likewise. * config/mips/mips.md (fixuns_truncdfsi2): Likewise. (fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise. (builtin_longjmp): Likewise. * config/mn10300/mn10300.md (call, call_value): Likewise. * config/pa/pa.md (nonlocal_goto, nonlocal_longjmp): Likewise. * config/pdp11/pdp11.md (abshi2): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. * config/s390/s390.c (s390_emit_prologue): Likewise. * config/s390/s390.md (movmem_long, setmem_long): Likewise. (cmpmem_long, extendsidi2, zero_extendsidi2, udivmoddi4): Likewise. (builtin_setjmp_receiver, restore_stack_nonlocal): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (output_stack_adjust, sh_expand_epilogue): Likewise. (sh_set_return_address, sh_expand_t_scc): Likewise. * config/sparc/sparc.c (load_pic_register): Likewise. * config/sparc/sparc.md (untyped_return, nonlocal_goto): Likewise. * config/spu/spu.c (spu_expand_epilogue): Likewise. * config/v850/v850.c (expand_epilogue): Likewise. From-SVN: r136251
2008-06-01 11:47:28 +02:00
emit_use (rr);
return;
}
if (TARGET_SH5)
{
int offset;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
save_schedule schedule;
save_entry *entry;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
entry = sh5_schedule_saves (&live_regs_mask, &schedule, 0);
offset = entry[1].offset;
for (; entry->mode != VOIDmode; entry--)
if (entry->reg == pr_reg)
goto found;
/* We can't find pr register. */
gcc_unreachable ();
found:
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
offset = entry->offset - offset;
pr_offset = (rounded_frame_size (d) + offset
+ SHMEDIA_REGS_STACK_ADJUST ());
}
else
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
pr_offset = rounded_frame_size (d);
emit_insn (GEN_MOV (tmp, GEN_INT (pr_offset)));
if (frame_pointer_needed)
emit_insn (GEN_ADD3 (tmp, tmp, hard_frame_pointer_rtx));
else
emit_insn (GEN_ADD3 (tmp, tmp, stack_pointer_rtx));
tmp = gen_frame_mem (Pmode, tmp);
emit_insn (GEN_MOV (tmp, ra));
/* Tell this store isn't dead. */
emit_use (tmp);
}
1995-04-21 03:19:27 +02:00
/* Clear variables at function end. */
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
sh_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
HOST_WIDE_INT size ATTRIBUTE_UNUSED)
1995-04-21 03:19:27 +02:00
{
}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
static rtx
sh_builtin_saveregs (void)
{
/* First unnamed integer register. */
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
int first_intreg = crtl->args.info.arg_count[(int) SH_ARG_INT];
/* Number of integer registers we need to save. */
int n_intregs = MAX (0, NPARM_REGS (SImode) - first_intreg);
/* First unnamed SFmode float reg */
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
int first_floatreg = crtl->args.info.arg_count[(int) SH_ARG_FLOAT];
/* Number of SFmode float regs to save. */
int n_floatregs = MAX (0, NPARM_REGS (SFmode) - first_floatreg);
rtx regbuf, fpregs;
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
int bufsize, regno;
alias.h (alias_set_type): Define new type. ./: * alias.h (alias_set_type): Define new type. (ALIAS_SET_MEMORY_BARRIER): Use it. * rtl.h: Include alias.h. (struct mem_attrs): Use alias_set_type. * tree.h: Include alias.h (struct tree_type): Use alias_set_type. (struct tree_struct_field_tag): Likewise. (struct tree_decl_common): Likewise. * alias.c (struct alias_set_entry): Use alias_set_type. (get_alias_set_entry, alias_set_subset_of): Likewise. (alias_sets_conflict_p): Likewise. (alias_sets_must_conflict_p): Likewise. (objects_must_conflict_p): Likewise. (get_alias_set, new_alias_set): Likewise. (record_alias_subset, record_component_aliases): Likewise. (varargs_set, frame_set): Change to alias_set_type. (get_varargs_alias_set): Use alias_set_type. (get_frame_alias_set): Likewise. * builtins.c (setjmp_alias_set): Change to alias_set_type. * dse.c (struct store_info): Use alias_set_type. (struct read_info, struct clear_alias_mode_holder): Likewise. (clear_alias_set_lookup, canon_address): Likewise. (record_store, check_mem_read_rtx): Likewise. (dse_record_singleton_alias_set): Likewise. (dse_invalidate_singleton_alias_set): Likewise. * emit-rtl.c (get_mem_attrs): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. * expr.c (store_constructor_field, store_field): Likewise. * gimplify.c (struct gimplify_init_ctor_preeval_data): Likewise. * langhooks.c (lhd_get_alias_set): Likewise. * langhooks-def.h (lhd_get_alias_set): Likewise. * reload1.c (alter_reg): Likewise. * tree-flow.h (struct fieldoff): Likewise. * tree-ssa-alias.c (struct alias_map_d): Likewise. (may_alias_p, get_smt_for, create_sft): Likewise. * tree-ssa-alias-warnings.c (nonstandard_alias_types_p): Likewise. * tree-ssa-structalias.c (set_uids_in_ptset): Likewise. (merge_smts_into): Likewise. * varasm.c (const_alias_set): Likewise. * c-common.c (strict_aliasing_warning): Likewise. (c_common_get_alias_set): Likewise. * dse.h (dse_record_singleton_alias_set): Update declaration. (dse_invalidate_singleton_alias_set): Likewise. * emit-rtl.h (set_mem_alias_set): Likewise. * c-common.h (c_common_get_alias_set): Likewise. * print-rtl.c (print_rtx): Cast MEM_ALIAS_SET when printing it. * print-tree.c (print_node): Likewise. * config/alpha/alpha.c (alpha_sr_alias_set): Change to alias_set_type. (alpha_setup_incoming_varargs): Use alias_set_type. * config/i386/i386.c (setup_incoming_varargs_64): Use alias_set_type. (setup_incoming_varargs_ms_64): Likewise. (ix86_GOT_alias_set): Likewise. * config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise. * config/rs6000/rs6000.c (setup_incoming_varargs): Likewise. (set): Change to alias_set_type. (get_TOC_alias_set): Use alias_set_type. * config/rs6000/rs6000-protos.h (get_TOC_alias_set): Update declaration. * config/sh/sh.c (sh_builtin_saveregs): Use alias_set_type. * config/sparc/sparc.c (sparc_sr_alias_set): Change to alias_set_type. (struct_value_alias_set): Likewise. * Makefile.in (GTFILES): Add $(srcdir)/alias.h. ada/: * misc.c (gnat_get_alias_set): Change return type to alias_set_type. cp/: * cp-objcp-common.c (cxx_get_alias_set): Change return type to alias_set_type. * cp/cp-tree.h (cxx_get_alias_set): Update declaration. fortran:/ * f95-lang.c (gfc_get_alias_set): Change return type to alias_set_type. From-SVN: r127362
2007-08-11 19:21:56 +02:00
alias_set_type alias_set;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH5)
{
if (n_intregs)
{
int pushregs = n_intregs;
while (pushregs < NPARM_REGS (SImode) - 1
&& (CALL_COOKIE_INT_REG_GET
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->args.info.call_cookie,
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
NPARM_REGS (SImode) - pushregs)
== 1))
{
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->args.info.call_cookie
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
&= ~ CALL_COOKIE_INT_REG (NPARM_REGS (SImode)
- pushregs, 1);
pushregs++;
}
if (pushregs == NPARM_REGS (SImode))
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->args.info.call_cookie
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
|= (CALL_COOKIE_INT_REG (0, 1)
| CALL_COOKIE_STACKSEQ (pushregs - 1));
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
crtl->args.info.call_cookie
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
|= CALL_COOKIE_STACKSEQ (pushregs);
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->args.pretend_args_size += 8 * n_intregs;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
if (TARGET_SHCOMPACT)
return const0_rtx;
}
if (! TARGET_SH2E && ! TARGET_SH4 && ! TARGET_SH5)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
error ("__builtin_saveregs not supported by this subtarget");
return const0_rtx;
}
if (TARGET_SHMEDIA)
n_floatregs = 0;
/* Allocate block of memory for the regs. */
/* ??? If n_intregs + n_floatregs == 0, should we allocate at least 1 byte?
Or can assign_stack_local accept a 0 SIZE argument? */
bufsize = (n_intregs * UNITS_PER_WORD) + (n_floatregs * UNITS_PER_WORD);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHMEDIA)
regbuf = gen_frame_mem (BLKmode, gen_rtx_REG (Pmode, ARG_POINTER_REGNUM));
else if (n_floatregs & 1)
{
rtx addr;
regbuf = assign_stack_local (BLKmode, bufsize + UNITS_PER_WORD, 0);
addr = copy_to_mode_reg (Pmode, XEXP (regbuf, 0));
emit_insn (gen_iorsi3 (addr, addr, GEN_INT (UNITS_PER_WORD)));
regbuf = change_address (regbuf, BLKmode, addr);
}
else if (STACK_BOUNDARY < 64 && TARGET_FPU_DOUBLE && n_floatregs)
{
rtx addr, mask;
regbuf = assign_stack_local (BLKmode, bufsize + UNITS_PER_WORD, 0);
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
addr = copy_to_mode_reg (Pmode, plus_constant (Pmode,
XEXP (regbuf, 0), 4));
mask = copy_to_mode_reg (Pmode, GEN_INT (-8));
emit_insn (gen_andsi3 (addr, addr, mask));
regbuf = change_address (regbuf, BLKmode, addr);
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
else
regbuf = assign_stack_local (BLKmode, bufsize, TARGET_FPU_DOUBLE ? 64 : 0);
alias_set = get_varargs_alias_set ();
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 (regbuf, alias_set);
/* Save int args.
This is optimized to only save the regs that are necessary. Explicitly
named args need not be saved. */
if (n_intregs > 0)
move_block_from_reg (BASE_ARG_REG (SImode) + first_intreg,
adjust_address (regbuf, BLKmode,
n_floatregs * UNITS_PER_WORD),
n_intregs);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SHMEDIA)
/* Return the address of the regbuf. */
return XEXP (regbuf, 0);
/* Save float args.
This is optimized to only save the regs that are necessary. Explicitly
named args need not be saved.
We explicitly build a pointer to the buffer because it halves the insn
count when not optimizing (otherwise the pointer is built for each reg
saved).
We emit the moves in reverse order so that we can use predecrement. */
fpregs = copy_to_mode_reg (Pmode,
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
plus_constant (Pmode, XEXP (regbuf, 0),
n_floatregs * UNITS_PER_WORD));
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
if (TARGET_SH4 || TARGET_SH2A_DOUBLE)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
rtx mem;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
for (regno = NPARM_REGS (DFmode) - 2; regno >= first_floatreg; regno -= 2)
{
emit_insn (gen_addsi3 (fpregs, fpregs,
GEN_INT (-2 * UNITS_PER_WORD)));
mem = change_address (regbuf, DFmode, fpregs);
emit_move_insn (mem,
gen_rtx_REG (DFmode, BASE_ARG_REG (DFmode) + regno));
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
regno = first_floatreg;
if (regno & 1)
{
emit_insn (gen_addsi3 (fpregs, fpregs, GEN_INT (-UNITS_PER_WORD)));
mem = change_address (regbuf, SFmode, fpregs);
emit_move_insn (mem,
gen_rtx_REG (SFmode, BASE_ARG_REG (SFmode) + regno
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
- (TARGET_LITTLE_ENDIAN != 0)));
}
}
else
for (regno = NPARM_REGS (SFmode) - 1; regno >= first_floatreg; regno--)
{
rtx mem;
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
emit_insn (gen_addsi3 (fpregs, fpregs, GEN_INT (-UNITS_PER_WORD)));
mem = change_address (regbuf, SFmode, fpregs);
emit_move_insn (mem,
gen_rtx_REG (SFmode, BASE_ARG_REG (SFmode) + regno));
}
/* Return the address of the regbuf. */
return XEXP (regbuf, 0);
}
/* Define the `__builtin_va_list' type for the ABI. */
static tree
sh_build_builtin_va_list (void)
{
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
tree record, type_decl;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (TARGET_SH5 || (! TARGET_SH2E && ! TARGET_SH4)
|| TARGET_HITACHI || sh_cfun_attr_renesas_p ())
return ptr_type_node;
record = (*lang_hooks.types.make_type) (RECORD_TYPE);
type_decl = build_decl (BUILTINS_LOCATION,
TYPE_DECL, get_identifier ("__va_list_tag"), record);
f_next_o = build_decl (BUILTINS_LOCATION,
FIELD_DECL, get_identifier ("__va_next_o"),
ptr_type_node);
f_next_o_limit = build_decl (BUILTINS_LOCATION,
FIELD_DECL,
get_identifier ("__va_next_o_limit"),
ptr_type_node);
f_next_fp = build_decl (BUILTINS_LOCATION,
FIELD_DECL, get_identifier ("__va_next_fp"),
ptr_type_node);
f_next_fp_limit = build_decl (BUILTINS_LOCATION,
FIELD_DECL,
get_identifier ("__va_next_fp_limit"),
ptr_type_node);
f_next_stack = build_decl (BUILTINS_LOCATION,
FIELD_DECL, get_identifier ("__va_next_stack"),
ptr_type_node);
DECL_FIELD_CONTEXT (f_next_o) = record;
DECL_FIELD_CONTEXT (f_next_o_limit) = record;
DECL_FIELD_CONTEXT (f_next_fp) = record;
DECL_FIELD_CONTEXT (f_next_fp_limit) = record;
DECL_FIELD_CONTEXT (f_next_stack) = record;
TYPE_STUB_DECL (record) = type_decl;
TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_next_o;
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
DECL_CHAIN (f_next_o) = f_next_o_limit;
DECL_CHAIN (f_next_o_limit) = f_next_fp;
DECL_CHAIN (f_next_fp) = f_next_fp_limit;
DECL_CHAIN (f_next_fp_limit) = f_next_stack;
layout_type (record);
return record;
}
/* Implement `va_start' for varargs and stdarg. */
re PR middle-end/20983 (varargs functions force va_list variable to stack unnecessarily) PR middle-end/20983 * tree-ssa-ccp.c (optimize_stdarg_builtin): New function. (execute_fold_all_builtins): Call it for BUILT_IN_VA_START, BUILT_IN_VA_COPY and BUILT_IN_VA_END. * target.h (struct ggc_target): Add expand_builtin_va_start hook. * target-def.h (TARGET_EXPAND_BUILTIN_VA_START): Define. (TARGET_INITIALIZER): Add it. * builtins.c (expand_builtin_va_start): Use targetm.expand_builtin_va_start hook instead of EXPAND_BUILTIN_VA_START macro. * alpha/alpha.c (alpha_va_start): Made static. (override_options): Clear targetm.expand_builtin_va_start if TARGET_UNICOSMK. (TARGET_EXPAND_BUILTIN_VA_START): Define. * alpha/unicosmk.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha.h (EXPAND_BUILTIN_VA_START): Remove. * alpha/alpha-protos.h (alpha_va_start): Remove prototype. * xtensa/xtensa.h (EXPAND_BUILTIN_VA_START): Remove. * xtensa/xtensa.c (TARGET_EXPAND_BUILTIN_VA_START): Define. (xtensa_va_start): Made static. * xtensa/xtensa-protos.h (xtensa_va_start): Remove prototype. * pa/pa-protos.h (hppa_va_start): Remove prototype. * pa/pa.h (EXPAND_BUILTIN_VA_START): Remove. * pa/pa.c (hppa_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv.c (frv_expand_builtin_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * frv/frv-protos.h (frv_expand_builtin_va_start): Remove prototype. * frv/frv.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386.c (override_options): Clear targetm.expand_builtin_va_start if -m32 or 64-bit MS ABI. (ix86_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * i386/i386.h (EXPAND_BUILTIN_VA_START): Remove. * i386/i386-protos.h (ix86_va_start, ix86_va_arg): Remove prototypes. * iq2000/iq2000-protos.h (iq2000_va_start): Remove prototype. * iq2000/iq2000.h (EXPAND_BUILTIN_VA_START): Remove. * iq2000/iq2000.c (iq2000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * rs6000/rs6000-protos.h (rs6000_va_start): Remove prototype. * rs6000/rs6000.c (rs6000_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. (rs6000_override_options): Clear targetm.expand_builtin_va_start if DEFAULT_ABI != ABI_V4. * rs6000/rs6000.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu.c (spu_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * spu/spu.h (EXPAND_BUILTIN_VA_START): Remove. * spu/spu-protos.h spu_va_start): Remove prototype. * stormy16/stormy16.h (EXPAND_BUILTIN_VA_START): Remove. * stormy16/stormy16-protos.h (xstormy16_expand_builtin_va_start): Remove prototype. * stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390-protos.h (s390_va_start): Remove prototype. * s390/s390.c (s390_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. * s390/s390.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300.h (EXPAND_BUILTIN_VA_START): Remove. * mn10300/mn10300-protos.h (mn10300_va_start): Remove prototype. * mn10300/mn10300.c (mn10300_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.c (arc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * arc/arc.h (EXPAND_BUILTIN_VA_START): Remove. * arc/arc-protos.h (arc_va_start): Remove prototype. * mt/mt-protos.h (mt_va_start): Remove prototype. * sparc/sparc.c (sparc_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sparc/sparc-protos.h (sparc_va_start): Remove prototype. * sparc/sparc.h (EXPAND_BUILTIN_VA_START): Remove. * sh/sh.c (sh_va_start): Made static, add prototype. (TARGET_EXPAND_BUILTIN_VA_START): Define. * sh/sh-protos.h (sh_va_start): Remove prototype. * sh/sh.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips-protos.h (mips_va_start): Remove prototype. * mips/mips.h (EXPAND_BUILTIN_VA_START): Remove. * mips/mips.c (mips_va_start): Made static. (TARGET_EXPAND_BUILTIN_VA_START): Define. From-SVN: r130650
2007-12-06 14:25:37 +01:00
static void
sh_va_start (tree valist, rtx nextarg)
{
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
tree t, u;
int nfp, nint;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH5)
{
expand_builtin_saveregs ();
std_expand_builtin_va_start (valist, nextarg);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return;
}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if ((! TARGET_SH2E && ! TARGET_SH4)
|| TARGET_HITACHI || sh_cfun_attr_renesas_p ())
{
std_expand_builtin_va_start (valist, nextarg);
return;
}
f_next_o = TYPE_FIELDS (va_list_type_node);
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
f_next_o_limit = DECL_CHAIN (f_next_o);
f_next_fp = DECL_CHAIN (f_next_o_limit);
f_next_fp_limit = DECL_CHAIN (f_next_fp);
f_next_stack = DECL_CHAIN (f_next_fp_limit);
next_o = build3 (COMPONENT_REF, TREE_TYPE (f_next_o), valist, f_next_o,
alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset. * alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset. * c-decl.c (build_array_declarator): Add news args for ARRAY_REF. * c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list. (gimplify_decl_stmt): Call gimplify_type_sizes for type. For decl, call gimplify_one_sizepos and use statement list. (gimplify_compound_literal_expr): New arg PRE_P. Add statement to PRE_P list and return DECL. (c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to gimplify_compound_literal_expr. * c-tree.h (getdecls): Deleted. * c-typeck.c (build_component_ref): Add operand for COMPONENT_REF. (build_array_ref): Add two operands for ARRAY_REF. (build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for COMPOUND_LITERAL_EXPR. * coverage.c (tree_coverage_counter_ref): Add new operands for ARRAY_REF. * emit-rtl.c (component_ref_for_mem_expr): Add new operand for COMPONENT_REF. (set_mem_attributes_minus_bitpos): Use array_ref_low_bound and array_ref_element_size. (widen_memory_access):Use component_ref_field_offset. * explow.c (update_nonlocal_goto_save_area): Add two operands for ARRAY_REF. * expr.c (array_ref_element_size, array_ref_low_bound): New functions. (component_ref_field_offset): Likewise. (get_inner_reference): Use them. (expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound. * fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE. (fold_read_from_constant_string): Use array_ref_low_bound. Verify that result is a character type. (build_fold_indirect_ref): Add two operands for ARRAY_REF. * function.c (expand_function_start): Likewise. * gimple-low.c (expand_var_p): Delete duplicated line. * gimplify.c: Add static decls for local functions. (cgraph.h): Now included. (create_tmp_var): Remove check for ARRAY_TYPE. (copy_if_shared_r): Look at bounds and sizes of types. (build_and_jump): Return alloc_stmt_list instead of build_empty_stmt. (gimplify_exit_expr, shortcut_cond_expr): Likewise. (gimplify_save_expr, gimple_push_cleanup): Likewise. (gimplify_init_constructor): Likewise. WANT_VALUE now bool. If empty list with no result wanted, return GS_UNHANDLED. Add additional operands for ARRAY_REF and COMPONENT_REF. (canonicalize_component_ref): Convert to &array[L]. (gimplify_array_ref_to_plus): Use array_ref_element_size and array_ref_lower_bound. (build_addr_expr_with_type, build_addr_expr): New functions. (gimplify_compound_lval): WANT_LVALUE now bool. Major rework to allow handle_component_p and initialize and gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and COMPONENT_REF. (gimplify_array_ref): Deleted. (gimplify_self_mod_expr): WANT_VALUE now bool. (gimplify_modify_expr): Gimplify to_p and from_p later. Factor out code into gimplify_modify_expr_rhs and call twice. Move variable-size code earlier and handle PLACEHOLDER_EXPR. (gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns. (gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case. (gimplify_expr, case ARRAY_REF): Delete special case. Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF, IMAGPART, and REALPART the same way. (gimplify_expr, case VIEW_CONVERT_EXPR): New case. (gimplify_expr): Call gimplify_variable_sized_compare if applicable. Call alloc_stmt_list instead of build_empty_stmt. Deal with _REF that's volatile. (gimplify_type_sizes, gimplify_one_sizepos): New functions. (unshare_body, unvisit_body): New functions. (gimplify_body): Call them. * stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE. * stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT. * tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF. * tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF like ARRAY_REF. (verify_expr, case ADDR_EXPR): Use handled_component_p. * tree-dfa.c (get_virtual_var): Likewise. * tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF): New cases to dump new operands; likewise for ARRAY_RANGE_REF. * tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF. * tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF and INDIRECT_REF. (get_base_address): Use handled_component_p. * tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New. * tree-line.c (walk_tree): Walk more things for types and decls. * tree-mudflap.c (mf_build_check_statement_for): Add new operands for ARRAY_REF and COMPONENT_REF. (mx_xform_derefs_1): Clean up usage of decl sizes. * tree-nested.c (build_addr): Use handled_component_p. (walk_stmts, case CATCH_EXPR): Add missing "break". (get_static_chain, get_frame_field): Add new operand for COMPONENT_REF. (finalize_nesting_tree_1): Likewise. (convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF and process additional operands. (convert_local_reference): Likewise. * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat ARRAY_RANGE_REF similarly to ARRAY_REF. * tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle like RECORD_TYPE. (dump_generic_node, case COMPONENT_REF): Print offset operand. (dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF and print lower bound and element size for both. (op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF. * tree-sra.c (csc_build_component_ref): Add new operand. (scalarize_call_expr): Use get_base_address. * tree-ssa-ccp.c (widen_bitfield): Clean up size handling. (maybe_fold_offset_to_array_ref): Rework to handle input having an ARRAY_REF, refine handling of lower bound, and add new operands for ARRAY_REF. (maybe_fold_to_component_ref): Add new operand for COMPONENT_REF. (maybe_fold_stmt_indirect): Only fold *&B to B if types match. (maybe_fold_stmt_addition): Only handle constant lower bound. * tree-ssa-operands.c (get_expr_operands): Minor rearrangements. Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands. Look at new offset operand of COMPONENT_REF. * tree-ssa.c (set_is_used): Use handled_component_p. * tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand. (stabilize_reference, case COMPONENT_REF): Likewise. (stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly. (recompute_tree_invariant_for_addr_expr): Completely rework to be more precise. Also set TREE_SIDE_EFFECTS. (build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here. (build2_stat, build3_stat, build4_stat): For references, propagate TREE_THIS_VOLATILE. (get_unwidened): Add new operand for COMPONENT_REF. (get_narrower): Likewise; use host_integerp for DECL_SIZE. * tree.def (COMPONENT_REF): Add new operand. (ARRAY_REF, ARRAY_RANGE_REF): Add two new operands. * tree.h (array_ref_element_size, array_ref_low_bound): New decls. (component_ref_field_offset): Likewise. * config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF. (alpha_gimplify_va_arg): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start, i860_va_arg): Likewise. * config/iq2000/iq2000.c (iq2000_va_arg): Likewise. * config/mips/mips.c (mips_va_start, mips_va_arg): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start, sh_va_arg): Likewise. * config/stormy16/stormy16.c (xstormy1_expand_builin_va_start): Likewise. (xstormy16_expand_builtin_va_arg): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise. * cp/call.c (build_vfield_ref): Add new operand for COMPONENT_REF. (build_new_method_call): Likewise. * cp/decl.c (local_variable_p_walkfn): Don't walk into types. * cp/decl2.c (grok_array_decl): Add new operands for ARRAY_REF. (build_anon_union_vars): Add new operand for COMPONENT_REF. * cp/init.c (buld_new): Add new operand for ARRAY_REF. * cp/method.c (do_build_copy_constructor): New op for COMPONENT_REF. (do_build_assign_ref): Likewise. * cp/parser.c (cp_parser_direct_new_declarator): Add new operands for ARRAY_REF. (cp_parser_direct_declarator): Likewise. * cp/pt.c (tsubst): Likewise. (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand for COMPONENT_REF. * cp/semantics.c (finish_non_static_data_member): Add new operand for COMPONENT_REF. * cp/typeck.c (build_class_member_access_expr): Likewise. (build_class_member_access_expr, finish_class_member_access_expr): Likewise. (build_ptrmemfunc_access_expr): Likewise. (build_array_ref): Add new operands for ARRAY_REF. * cp/typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too. * cp/tree.c (count_trees_r, no_linkage_helper): Don't walk in types. * fortran/f95-lang.c (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Deleted. * fortran/trans-array.c (gfc_conv_descriptor_data): Add operand for COMPONENT_REF. (gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype): Likewise. (gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride): Likewise. (gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound): Likewise. * fortran/trans-common.c (create_common): Likewise. * fortran/trans-expr.c (gfc_conv_component_ref): Likewise. * fortran/trans-io.c (set_parameter_value): Likewise. (set_parameter_ref, set_string, set_flag, io_result): Likewise. (transfer_expr): Likewise. * fortran/trans-decl.c (gfc_trans_auto_character_variable): Set up to get DECL_SIZE and DECL_SIZE_UNIT gimplified. (gfc_simplify_function): New function. (gfc_generate_function-code): Properly handle nested functions. * fortran/trans.c (gfc_build_array_ref): Add two new operands for ARRAY_REF. * java/class.c (build_class_ref): Add new operand for COMPONENT_REF. (build_static_field_ref): Likewise and add new operands for ARRAY_REF. * java/constants.c (build_ref_from_constant_pool): Likewise. * java/expr.c (build_java_array_length_access): Likewise. (build_get_class, build_field_ref, build_known_method_ref): Likewise. (invoke_build_dtable, build_invokevirtual): Likewise. (build_invokeinterface, java_expand_expr): Likewise. (emit_init_test_initialization): Likewise. * java/java-gimplify.c (java_gimplify_new_array_init): Likewise. * java/parse.y (make_qualifed_name, build_array_ref): Likewise. * objc/ojbc-act.c (generate_static_references): Add additional operands to ARRAY_REF. (generate_strings, build_method_prototype_list_template): Likewise. (generate_protocol_list): Likewise. From-SVN: r83474
2004-06-22 05:07:05 +02:00
NULL_TREE);
next_o_limit = build3 (COMPONENT_REF, TREE_TYPE (f_next_o_limit),
valist, f_next_o_limit, NULL_TREE);
next_fp = build3 (COMPONENT_REF, TREE_TYPE (f_next_fp), valist, f_next_fp,
NULL_TREE);
next_fp_limit = build3 (COMPONENT_REF, TREE_TYPE (f_next_fp_limit),
valist, f_next_fp_limit, NULL_TREE);
next_stack = build3 (COMPONENT_REF, TREE_TYPE (f_next_stack),
valist, f_next_stack, NULL_TREE);
/* Call __builtin_saveregs. */
[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
u = make_tree (sizetype, expand_builtin_saveregs ());
u = fold_convert (ptr_type_node, u);
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
t = build2 (MODIFY_EXPR, ptr_type_node, next_fp, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
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
nfp = crtl->args.info.arg_count[SH_ARG_FLOAT];
if (nfp < 8)
nfp = 8 - nfp;
else
nfp = 0;
tree.h (fold_build_pointer_plus_loc): New helper function. 2011-07-19 Richard Guenther <rguenther@suse.de> * tree.h (fold_build_pointer_plus_loc): New helper function. (fold_build_pointer_plus_hwi_loc): Likewise. (fold_build_pointer_plus): Define. (fold_build_pointer_plus_hwi): Likewise. * builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus. (fold_builtin_memory_op): Likewise. (fold_builtin_stpcpy): Likewise. (fold_builtin_memchr): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. * c-typeck.c (build_unary_op): Likewise. * cgraphunit.c (thunk_adjust): Likewise. * fold-const.c (build_range_check): Likewise. (fold_binary_loc): Likewise. * omp-low.c (extract_omp_for_data): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_for_static_chunk): Likewise. * tree-affine.c (add_elt_to_tree): Likewise. * tree-data-ref.c (split_constant_offset_1): Likewise. * tree-loop-distribution.c (generate_memset_zero): Likewise. * tree-mudflap.c (mf_xform_derefs_1): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): Likewise. (add_to_parts): Likewise. (create_mem_ref): Likewise. * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise. (number_of_iterations_le): Likewise. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise. * tree-vect-data-refs.c (vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Likewise. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise. (vect_create_cond_for_alias_checks): Likewise. * tree-vrp.c (extract_range_from_assert): Likewise. * config/alpha/alpha.c (alpha_va_start): Likewise. (alpha_gimplify_va_arg_1): Likewise. * config/i386/i386.c (ix86_va_start): Likewise. (ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mep/mep.c (mep_expand_va_start): Likewise. (mep_gimplify_va_arg_expr): Likewise. * config/mips/mips.c (mips_va_start): Likewise. (mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start): Likewise. (rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start): Likewise. (s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start): Likewise. (sh_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Likewise. (spu_gimplify_va_arg_expr): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. (xstormy16_gimplify_va_arg_expr): Likewise. * config/xtensa/xtensa.c (xtensa_va_start): Likewise. (xtensa_gimplify_va_arg_expr): Likewise. c-family/ * c-common.c (pointer_int_sum): Use fold_build_pointer_plus. * c-omp.c (c_finish_omp_for): Likewise. cp/ * call.c (build_special_member_call): Use fold_build_pointer_plus. * class.c (build_base_path): Likewise. (convert_to_base_statically): Likewise. (dfs_accumulate_vtbl_inits): Likewise. * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise. * except.c (expand_start_catch_block): Likewise. * init.c (expand_virtual_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * rtti.c (build_headof): Likewise. (tinfo_base_init): Likewise. * typeck.c (get_member_function_from_ptrfunc): Likewise. (cp_build_addr_expr_1): Likewise. * typeck2.c (build_m_component_ref): Likewise. fortran/ * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus. (gfc_trans_string_copy): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. * trans.c (gfc_build_array_ref): Likewise. java/ * builtins.c (static): Use fold_build_pointer_plus. * class.c (make_class_data): Likewise. (build_symbol_entry): Likewise. * except.c (build_exception_object_ref): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. objc/ * objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref): Use fold_build_pointer_plus. (objc2_build_ehtype_initializer): Likewise. From-SVN: r176461
2011-07-19 16:01:59 +02:00
u = fold_build_pointer_plus_hwi (u, UNITS_PER_WORD * nfp);
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
t = build2 (MODIFY_EXPR, ptr_type_node, next_fp_limit, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
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
t = build2 (MODIFY_EXPR, ptr_type_node, next_o, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
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
nint = crtl->args.info.arg_count[SH_ARG_INT];
if (nint < 4)
nint = 4 - nint;
else
nint = 0;
tree.h (fold_build_pointer_plus_loc): New helper function. 2011-07-19 Richard Guenther <rguenther@suse.de> * tree.h (fold_build_pointer_plus_loc): New helper function. (fold_build_pointer_plus_hwi_loc): Likewise. (fold_build_pointer_plus): Define. (fold_build_pointer_plus_hwi): Likewise. * builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus. (fold_builtin_memory_op): Likewise. (fold_builtin_stpcpy): Likewise. (fold_builtin_memchr): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. * c-typeck.c (build_unary_op): Likewise. * cgraphunit.c (thunk_adjust): Likewise. * fold-const.c (build_range_check): Likewise. (fold_binary_loc): Likewise. * omp-low.c (extract_omp_for_data): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_for_static_chunk): Likewise. * tree-affine.c (add_elt_to_tree): Likewise. * tree-data-ref.c (split_constant_offset_1): Likewise. * tree-loop-distribution.c (generate_memset_zero): Likewise. * tree-mudflap.c (mf_xform_derefs_1): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): Likewise. (add_to_parts): Likewise. (create_mem_ref): Likewise. * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise. (number_of_iterations_le): Likewise. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise. * tree-vect-data-refs.c (vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Likewise. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise. (vect_create_cond_for_alias_checks): Likewise. * tree-vrp.c (extract_range_from_assert): Likewise. * config/alpha/alpha.c (alpha_va_start): Likewise. (alpha_gimplify_va_arg_1): Likewise. * config/i386/i386.c (ix86_va_start): Likewise. (ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mep/mep.c (mep_expand_va_start): Likewise. (mep_gimplify_va_arg_expr): Likewise. * config/mips/mips.c (mips_va_start): Likewise. (mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start): Likewise. (rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start): Likewise. (s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start): Likewise. (sh_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Likewise. (spu_gimplify_va_arg_expr): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. (xstormy16_gimplify_va_arg_expr): Likewise. * config/xtensa/xtensa.c (xtensa_va_start): Likewise. (xtensa_gimplify_va_arg_expr): Likewise. c-family/ * c-common.c (pointer_int_sum): Use fold_build_pointer_plus. * c-omp.c (c_finish_omp_for): Likewise. cp/ * call.c (build_special_member_call): Use fold_build_pointer_plus. * class.c (build_base_path): Likewise. (convert_to_base_statically): Likewise. (dfs_accumulate_vtbl_inits): Likewise. * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise. * except.c (expand_start_catch_block): Likewise. * init.c (expand_virtual_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * rtti.c (build_headof): Likewise. (tinfo_base_init): Likewise. * typeck.c (get_member_function_from_ptrfunc): Likewise. (cp_build_addr_expr_1): Likewise. * typeck2.c (build_m_component_ref): Likewise. fortran/ * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus. (gfc_trans_string_copy): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. * trans.c (gfc_build_array_ref): Likewise. java/ * builtins.c (static): Use fold_build_pointer_plus. * class.c (make_class_data): Likewise. (build_symbol_entry): Likewise. * except.c (build_exception_object_ref): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. objc/ * objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref): Use fold_build_pointer_plus. (objc2_build_ehtype_initializer): Likewise. From-SVN: r176461
2011-07-19 16:01:59 +02:00
u = fold_build_pointer_plus_hwi (u, UNITS_PER_WORD * nint);
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
t = build2 (MODIFY_EXPR, ptr_type_node, next_o_limit, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
u = make_tree (ptr_type_node, nextarg);
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
t = build2 (MODIFY_EXPR, ptr_type_node, next_stack, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
/* TYPE is a RECORD_TYPE. If there is only a single nonzero-sized
member, return it. */
static tree
find_sole_member (tree type)
{
tree field, member = NULL_TREE;
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
if (TREE_CODE (field) != FIELD_DECL)
continue;
if (!DECL_SIZE (field))
return NULL_TREE;
if (integer_zerop (DECL_SIZE (field)))
continue;
if (member)
return NULL_TREE;
member = field;
}
return member;
}
/* 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
sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
gimple_seq *post_p ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT size, rsize;
tree tmp, pptr_type_node;
tree addr, lab_over = NULL, result = NULL;
bool pass_by_ref;
tree eff_type;
if (!VOID_TYPE_P (type))
pass_by_ref = targetm.calls.must_pass_in_stack (TYPE_MODE (type), type);
else
pass_by_ref = false;
if (pass_by_ref)
type = build_pointer_type (type);
size = int_size_in_bytes (type);
rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
pptr_type_node = build_pointer_type (ptr_type_node);
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (! TARGET_SH5 && (TARGET_SH2E || TARGET_SH4)
&& ! (TARGET_HITACHI || sh_cfun_attr_renesas_p ()))
{
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
int pass_as_float;
tree lab_false;
tree member;
f_next_o = TYPE_FIELDS (va_list_type_node);
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
f_next_o_limit = DECL_CHAIN (f_next_o);
f_next_fp = DECL_CHAIN (f_next_o_limit);
f_next_fp_limit = DECL_CHAIN (f_next_fp);
f_next_stack = DECL_CHAIN (f_next_fp_limit);
next_o = build3 (COMPONENT_REF, TREE_TYPE (f_next_o), valist, f_next_o,
NULL_TREE);
next_o_limit = build3 (COMPONENT_REF, TREE_TYPE (f_next_o_limit),
valist, f_next_o_limit, NULL_TREE);
next_fp = build3 (COMPONENT_REF, TREE_TYPE (f_next_fp),
valist, f_next_fp, NULL_TREE);
next_fp_limit = build3 (COMPONENT_REF, TREE_TYPE (f_next_fp_limit),
valist, f_next_fp_limit, NULL_TREE);
next_stack = build3 (COMPONENT_REF, TREE_TYPE (f_next_stack),
valist, f_next_stack, NULL_TREE);
/* Structures with a single member with a distinct mode are passed
like their member. This is relevant if the latter has a REAL_TYPE
or COMPLEX_TYPE type. */
eff_type = type;
while (TREE_CODE (eff_type) == RECORD_TYPE
&& (member = find_sole_member (eff_type))
&& (TREE_CODE (TREE_TYPE (member)) == REAL_TYPE
|| TREE_CODE (TREE_TYPE (member)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (member)) == RECORD_TYPE))
{
tree field_type = TREE_TYPE (member);
if (TYPE_MODE (eff_type) == TYPE_MODE (field_type))
eff_type = field_type;
else
{
gcc_assert ((TYPE_ALIGN (eff_type)
< GET_MODE_ALIGNMENT (TYPE_MODE (field_type)))
|| (TYPE_ALIGN (eff_type)
> GET_MODE_BITSIZE (TYPE_MODE (field_type))));
break;
}
}
if (TARGET_SH4 || TARGET_SH2A_DOUBLE)
{
pass_as_float = ((TREE_CODE (eff_type) == REAL_TYPE && size <= 8)
|| (TREE_CODE (eff_type) == COMPLEX_TYPE
&& TREE_CODE (TREE_TYPE (eff_type)) == REAL_TYPE
&& size <= 16));
}
else
{
pass_as_float = (TREE_CODE (eff_type) == REAL_TYPE && size == 4);
}
addr = create_tmp_var (pptr_type_node, NULL);
lab_false = create_artificial_label (UNKNOWN_LOCATION);
lab_over = create_artificial_label (UNKNOWN_LOCATION);
re PR middle-end/42834 (memcpy folding overeager) 2010-07-01 Richard Guenther <rguenther@suse.de> PR middle-end/42834 PR middle-end/44468 * doc/gimple.texi (is_gimple_mem_ref_addr): Document. * doc/generic.texi (References to storage): Document MEM_REF. * tree-pretty-print.c (dump_generic_node): Handle MEM_REF. (print_call_name): Likewise. * tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF. (build_simple_mem_ref_loc): New function. (mem_ref_offset): Likewise. * tree.h (build_simple_mem_ref_loc): Declare. (build_simple_mem_ref): Define. (mem_ref_offset): Declare. * fold-const.c: Include tree-flow.h. (operand_equal_p): Handle MEM_REF. (build_fold_addr_expr_with_type_loc): Likewise. (fold_comparison): Likewise. (fold_unary_loc): Fold VIEW_CONVERT_EXPR <T1, MEM_REF <T2, ...>> to MEM_REF <T1, ...>. (fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2], fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2]. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF. (ptr_deref_may_alias_ref_p_1): Likewise. (ao_ref_base_alias_set): Properly differentiate base object for offset and TBAA. (ao_ref_init_from_ptr_and_size): Use MEM_REF. (indirect_ref_may_alias_decl_p): Handle MEM_REFs properly. (indirect_refs_may_alias_p): Likewise. (refs_may_alias_p_1): Likewise. Remove pointer SSA name def chasing code. (ref_maybe_used_by_call_p_1): Handle MEM_REF. (call_may_clobber_ref_p_1): Likewise. * dwarf2out.c (loc_list_from_tree): Handle MEM_REF. * expr.c (expand_assignment): Handle MEM_REF. (store_expr): Handle MEM_REFs from STRING_CSTs. (store_field): If expanding a MEM_REF of a non-addressable decl use bitfield operations. (get_inner_reference): Handle MEM_REF. (expand_expr_addr_expr_1): Likewise. (expand_expr_real_1): Likewise. * tree-eh.c (tree_could_trap_p): Handle MEM_REF. * alias.c (ao_ref_from_mem): Handle MEM_REF. (get_alias_set): Likewise. Properly handle VIEW_CONVERT_EXPRs. * tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF. (dr_analyze_indices): Likewise. (dr_analyze_alias): Likewise. (object_address_invariant_in_loop_p): Likewise. * gimplify.c (mark_addressable): Handle MEM_REF. (gimplify_cond_expr): Build MEM_REFs. (gimplify_modify_expr_to_memcpy): Likewise. (gimplify_init_ctor_preeval_1): Handle MEM_REF. (gimple_fold_indirect_ref): Adjust. (gimplify_expr): Handle MEM_REF. Gimplify INDIRECT_REF to MEM_REF. * tree.def (MEM_REF): New tree code. * tree-dfa.c: Include toplev.h. (get_ref_base_and_extent): Handle MEM_REF. (get_addr_base_and_unit_offset): New function. * emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF. * gimple-fold.c (may_propagate_address_into_dereference): Handle MEM_REF. (maybe_fold_offset_to_array_ref): Allow possibly out-of bounds accesses if the array has just one dimension. Remove always true parameter. Do not require type compatibility here. (maybe_fold_offset_to_component_ref): Remove. (maybe_fold_stmt_indirect): Remove. (maybe_fold_reference): Remove INDIRECT_REF handling. Fold back to non-MEM_REF. (maybe_fold_offset_to_address): Simplify. Deal with type mismatches here. (maybe_fold_reference): Likewise. (maybe_fold_stmt_addition): Likewise. Also handle &ARRAY + I in addition to &ARRAY[0] + I. (fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs. (gimple_get_relevant_ref_binfo): Handle MEM_REF. * cfgexpand.c (expand_debug_expr): Handle MEM_REF. * tree-ssa.c (useless_type_conversion_p): Make most pointer conversions useless. (warn_uninitialized_var): Handle MEM_REF. (maybe_rewrite_mem_ref_base): New function. (execute_update_addresses_taken): Implement re-writing of MEM_REFs to SSA form. * tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove INDIRECT_REF handling. (copy_tree_body_r): Handle MEM_REF. * gimple.c (is_gimple_addressable): Adjust. (is_gimple_address): Likewise. (is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with invariant base are invariant. (is_gimple_min_lval): Adjust. (is_gimple_mem_ref_addr): New function. (get_base_address): Handle MEM_REF. (count_ptr_derefs): Likewise. (get_base_loadstore): Likewise. * gimple.h (is_gimple_mem_ref_addr): Declare. (gimple_call_fndecl): Handle invariant MEM_REF addresses. * tree-cfg.c (verify_address): New function, split out from ... (verify_expr): ... here. Use for verifying ADDR_EXPRs and the address operand of MEM_REFs. Verify MEM_REFs. Reject INDIRECT_REFs. (verify_types_in_gimple_min_lval): Handle MEM_REF. Disallow INDIRECT_REF. Allow conversions. (verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of a register does not change its size. (verify_types_in_gimple_reference): Verify MEM_REF. (verify_gimple_assign_single): Disallow INDIRECT_REF. Handle MEM_REF. * tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable): New. (mark_address_taken): Handle MEM_REF. (get_indirect_ref_operands): Pass through opf_not_non_addressable. (get_asm_expr_operands): Pass opf_not_non_addressable. (get_expr_operands): Handle opf_[not_]non_addressable. Handle MEM_REF. Remove INDIRECT_REF handling. * tree-vrp.c: (check_array_ref): Handle MEM_REF. (search_for_addr_array): Likewise. (check_array_bounds): Likewise. (vrp_stmt_computes_nonzero): Adjust for MEM_REF. * tree-ssa-loop-im.c (for_each_index): Handle MEM_REF. (ref_always_accessed_p): Likewise. (gen_lsm_tmp_name): Likewise. Handle ADDR_EXPR. * tree-complex.c (extract_component): Do not handle INDIRECT_REF. Handle MEM_REF. * cgraphbuild.c (mark_load): Properly check for NULL result from get_base_address. (mark_store): Likewise. * tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF. * tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF handling for MEM_REF. * tree-scalar-evolution.c (follow_ssa_edge_expr): Handle &MEM[ptr + CST] similar to POINTER_PLUS_EXPR. * builtins.c (stabilize_va_list_loc): Use the function ABI valist type if we couldn't canonicalize the argument type. Always dereference with the canonical va-list type. (maybe_emit_free_warning): Handle MEM_REF. (fold_builtin_memory_op): Simplify and handle MEM_REFs in folding memmove to memcpy. * builtins.c (fold_builtin_memory_op): Use ref-all types for all memcpy foldings. * omp-low.c (build_receiver_ref): Adjust for MEM_REF. (build_outer_var_ref): Likewise. (scan_omp_1_op): Likewise. (lower_rec_input_clauses): Likewise. (lower_lastprivate_clauses): Likewise. (lower_reduction_clauses): Likewise. (lower_copyprivate_clauses): Likewise. (expand_omp_atomic_pipeline): Likewise. (expand_omp_atomic_mutex): Likewise. (create_task_copyfn): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF. Remove old union trick. Initialize constant offsets. (ao_ref_init_from_vn_reference): Likewise. Do not handle INDIRECT_REF. Init base_alias_set properly. (vn_reference_lookup_3): Replace INDIRECT_REF handling with MEM_REF. (vn_reference_fold_indirect): Adjust for MEM_REFs. (valueize_refs): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. (may_insert): Remove. (visit_reference_op_load): Do not test may_insert. (run_scc_vn): Remove parameter, do not fiddle with may_insert. * tree-ssa-sccvn.h (struct vn_reference_op_struct): Add a field to store the constant offset this op applies. (run_scc_vn): Adjust prototype. * cgraphunit.c (thunk_adjust): Adjust for MEM_REF. * tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with MEM_REF. Propagate &foo + CST as &MEM[&foo, CST]. Do not bother about volatile qualifiers on pointers. (fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF. * tree-ssa-loop-ivopts.c * tree-ssa-loop-ivopts.c (determine_base_object): Adjust for MEM_REF. (strip_offset_1): Likewise. (find_interesting_uses_address): Replace INDIRECT_REF handling with MEM_REF handling. (get_computation_cost_at): Likewise. * ipa-pure-const.c (check_op): Handle MEM_REF. * tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF. * tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF and constants. * ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF. * tree-parloops.c (take_address_of): Adjust for MEM_REF. (eliminate_local_variables_1): Likewise. (create_call_for_reduction_1): Likewise. (create_loads_for_reductions): Likewise. (create_loads_and_stores_for_name): Likewise. * matrix-reorg.c (may_flatten_matrices_1): Sanitize. (ssa_accessed_in_tree): Handle MEM_REF. (ssa_accessed_in_assign_rhs): Likewise. (update_type_size): Likewise. (analyze_accesses_for_call_stmt): Likewise. (analyze_accesses_for_assign_stmt): Likewise. (transform_access_sites): Likewise. (transform_allocation_sites): Likewise. * tree-affine.c (tree_to_aff_combination): Handle MEM_REF. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do not handle INDIRECT_REF. * tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF. (cond_store_replacement): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle MEM_REF, no not handle INDIRECT_REFs. (insert_into_preds_of_block): Properly initialize avail. (phi_translate_1): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. Properly handle reference lookups that require a bit re-interpretation. (can_PRE_operation): Do not handle INDIRECT_REF. Handle MEM_REF. * tree-sra.c * tree-sra.c (build_access_from_expr_1): Handle MEM_REF. (build_ref_for_offset_1): Remove. (build_ref_for_offset): Build MEM_REFs. (gate_intra_sra): Disable for now. (sra_ipa_modify_expr): Handle MEM_REF. (ipa_early_sra_gate): Disable for now. * tree-sra.c (create_access): Swap INDIRECT_REF handling for MEM_REF handling. (disqualify_base_of_expr): Likewise. (ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for MEM_REF handling. (sra_ipa_modify_expr): Remove INDIRECT_REF handling. Use mem_ref_offset. Remove bogus folding. (build_access_from_expr_1): Properly handle MEM_REF for non IPA-SRA. (make_fancy_name_1): Add support for MEM_REF. * tree-predcom.c (ref_at_iteration): Handle MEM_REFs. * tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF. * ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF. (compute_complex_ancestor_jump_func): Likewise. (ipa_analyze_virtual_call_uses): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace INDIRECT_REF folding with more generalized MEM_REF folding. (tree_ssa_forward_propagate_single_use_vars): Adjust accordingly. (forward_propagate_addr_into_variable_array_index): Also handle &ARRAY + I in addition to &ARRAY[0] + I. * tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF. * tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that creates assignments with overlap. * tree-nested.c (get_static_chain): Adjust for MEM_REF. (get_frame_field): Likewise. (get_nonlocal_debug_decl): Likewise. (convert_nonlocal_reference_op): Likewise. (struct nesting_info): Add mem_refs pointer-set. (create_nesting_tree): Allocate it. (convert_local_reference_op): Insert to be folded mem-refs. (fold_mem_refs): New function. (finalize_nesting_tree_1): Perform defered folding of mem-refs (free_nesting_tree): Free the pointer-set. * tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF. (vectorizable_load): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF. (propagate_with_phi): Likewise. * tree-object-size.c (addr_object_size): Handle MEM_REFs instead of INDIRECT_REFs. (compute_object_offset): Handle MEM_REF. (plus_stmt_object_size): Handle MEM_REF. (collect_object_sizes_for): Dispatch to plus_stmt_object_size for &MEM_REF. * tree-flow.h (get_addr_base_and_unit_offset): Declare. (symbol_marked_for_renaming): Likewise. * Makefile.in (tree-dfa.o): Add $(TOPLEV_H). (fold-const.o): Add $(TREE_FLOW_H). * tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF. (find_func_clobbers): Likewise. * ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF. (decompose_access): Likewise. (replace_field_acc): Likewise. (replace_field_access_stmt): Likewise. (insert_new_var_in_stmt): Likewise. (get_stmt_accesses): Likewise. (reorg_structs_drive): Disable. * config/i386/i386.c (ix86_va_start): Adjust for MEM_REF. (ix86_canonical_va_list_type): Likewise. cp/ * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs predicate we are looking for, allow non-gimplified INDIRECT_REFs. testsuite/ * gcc.c-torture/execute/20100316-1.c: New testcase. * gcc.c-torture/execute/pr44468.c: Likewise. * gcc.c-torture/compile/20100609-1.c: Likewise. * gcc.dg/volatile2.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/pr36902.c: Likewise. * gcc.dg/tree-ssa/foldaddr-2.c: Remove. * gcc.dg/tree-ssa/foldaddr-3.c: Likewise. * gcc.dg/tree-ssa/forwprop-8.c: Adjust. * gcc.dg/tree-ssa/pr17141-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-13.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise. * gcc.dg/tree-ssa/20030807-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-10.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise. * gcc.dg/tree-ssa/forwprop-1.c: Likewise. * gcc.dg/tree-ssa/forwprop-2.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-26.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise. * gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-5.c: Likewise. * gcc.dg/struct/w_prof_two_strs.c: XFAIL. * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise. * gcc.dg/struct/wo_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise. * gcc.dg/struct/w_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_str_init.c: Likewise. * gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise. * gcc.dg/struct/w_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_array_field.c: Likewise. * gcc.dg/struct/wo_prof_single_str_local.c: Likewise. * gcc.dg/struct/w_prof_local_var.c: Likewise. * gcc.dg/struct/wo_prof_two_strs.c: Likewise. * gcc.dg/struct/wo_prof_empty_str.c: Likewise. * gcc.dg/struct/wo_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise. * gcc.dg/struct/wo_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_escape_return.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise. * gcc.dg/struct/wo_prof_double_malloc.c: Likewise. * gcc.dg/struct/w_ratio_cold_str.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise. * gcc.dg/struct/wo_prof_local_var.c: Likewise. * gcc.dg/tree-prof/stringop-1.c: Adjust. * g++.dg/tree-ssa/pr31146.C: Likewise. * g++.dg/tree-ssa/copyprop-1.C: Likewise. * g++.dg/tree-ssa/pr33604.C: Likewise. * g++.dg/plugin/selfassign.c: Likewise. * gfortran.dg/array_memcpy_3.f90: Likewise. * gfortran.dg/array_memcpy_4.f90: Likewise. * c-c++-common/torture/pr42834.c: New testcase. From-SVN: r161655
2010-07-01 10:49:19 +02:00
valist = build_simple_mem_ref (addr);
if (pass_as_float)
{
tree next_fp_tmp = create_tmp_var (TREE_TYPE (f_next_fp), NULL);
tree cmp;
bool is_double = size == 8 && TREE_CODE (eff_type) == REAL_TYPE;
tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_fp));
gimplify_assign (unshare_expr (addr), tmp, pre_p);
gimplify_assign (unshare_expr (next_fp_tmp), valist, pre_p);
tmp = next_fp_limit;
if (size > 4 && !is_double)
tree.h (fold_build_pointer_plus_loc): New helper function. 2011-07-19 Richard Guenther <rguenther@suse.de> * tree.h (fold_build_pointer_plus_loc): New helper function. (fold_build_pointer_plus_hwi_loc): Likewise. (fold_build_pointer_plus): Define. (fold_build_pointer_plus_hwi): Likewise. * builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus. (fold_builtin_memory_op): Likewise. (fold_builtin_stpcpy): Likewise. (fold_builtin_memchr): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. * c-typeck.c (build_unary_op): Likewise. * cgraphunit.c (thunk_adjust): Likewise. * fold-const.c (build_range_check): Likewise. (fold_binary_loc): Likewise. * omp-low.c (extract_omp_for_data): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_for_static_chunk): Likewise. * tree-affine.c (add_elt_to_tree): Likewise. * tree-data-ref.c (split_constant_offset_1): Likewise. * tree-loop-distribution.c (generate_memset_zero): Likewise. * tree-mudflap.c (mf_xform_derefs_1): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): Likewise. (add_to_parts): Likewise. (create_mem_ref): Likewise. * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise. (number_of_iterations_le): Likewise. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise. * tree-vect-data-refs.c (vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Likewise. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise. (vect_create_cond_for_alias_checks): Likewise. * tree-vrp.c (extract_range_from_assert): Likewise. * config/alpha/alpha.c (alpha_va_start): Likewise. (alpha_gimplify_va_arg_1): Likewise. * config/i386/i386.c (ix86_va_start): Likewise. (ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mep/mep.c (mep_expand_va_start): Likewise. (mep_gimplify_va_arg_expr): Likewise. * config/mips/mips.c (mips_va_start): Likewise. (mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start): Likewise. (rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start): Likewise. (s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start): Likewise. (sh_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Likewise. (spu_gimplify_va_arg_expr): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. (xstormy16_gimplify_va_arg_expr): Likewise. * config/xtensa/xtensa.c (xtensa_va_start): Likewise. (xtensa_gimplify_va_arg_expr): Likewise. c-family/ * c-common.c (pointer_int_sum): Use fold_build_pointer_plus. * c-omp.c (c_finish_omp_for): Likewise. cp/ * call.c (build_special_member_call): Use fold_build_pointer_plus. * class.c (build_base_path): Likewise. (convert_to_base_statically): Likewise. (dfs_accumulate_vtbl_inits): Likewise. * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise. * except.c (expand_start_catch_block): Likewise. * init.c (expand_virtual_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * rtti.c (build_headof): Likewise. (tinfo_base_init): Likewise. * typeck.c (get_member_function_from_ptrfunc): Likewise. (cp_build_addr_expr_1): Likewise. * typeck2.c (build_m_component_ref): Likewise. fortran/ * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus. (gfc_trans_string_copy): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. * trans.c (gfc_build_array_ref): Likewise. java/ * builtins.c (static): Use fold_build_pointer_plus. * class.c (make_class_data): Likewise. (build_symbol_entry): Likewise. * except.c (build_exception_object_ref): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. objc/ * objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref): Use fold_build_pointer_plus. (objc2_build_ehtype_initializer): Likewise. From-SVN: r176461
2011-07-19 16:01:59 +02:00
tmp = fold_build_pointer_plus_hwi (unshare_expr (tmp), 4 - size);
tmp = build2 (GE_EXPR, boolean_type_node,
unshare_expr (next_fp_tmp), unshare_expr (tmp));
cmp = build3 (COND_EXPR, void_type_node, tmp,
build1 (GOTO_EXPR, void_type_node,
unshare_expr (lab_false)), NULL_TREE);
if (!is_double)
gimplify_and_add (cmp, pre_p);
if (TYPE_ALIGN (eff_type) > BITS_PER_WORD
|| (is_double || size == 16))
{
[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
tmp = fold_convert (sizetype, next_fp_tmp);
tmp = build2 (BIT_AND_EXPR, sizetype, tmp,
size_int (UNITS_PER_WORD));
tree.h (fold_build_pointer_plus_loc): New helper function. 2011-07-19 Richard Guenther <rguenther@suse.de> * tree.h (fold_build_pointer_plus_loc): New helper function. (fold_build_pointer_plus_hwi_loc): Likewise. (fold_build_pointer_plus): Define. (fold_build_pointer_plus_hwi): Likewise. * builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus. (fold_builtin_memory_op): Likewise. (fold_builtin_stpcpy): Likewise. (fold_builtin_memchr): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. * c-typeck.c (build_unary_op): Likewise. * cgraphunit.c (thunk_adjust): Likewise. * fold-const.c (build_range_check): Likewise. (fold_binary_loc): Likewise. * omp-low.c (extract_omp_for_data): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_for_static_chunk): Likewise. * tree-affine.c (add_elt_to_tree): Likewise. * tree-data-ref.c (split_constant_offset_1): Likewise. * tree-loop-distribution.c (generate_memset_zero): Likewise. * tree-mudflap.c (mf_xform_derefs_1): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): Likewise. (add_to_parts): Likewise. (create_mem_ref): Likewise. * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise. (number_of_iterations_le): Likewise. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise. * tree-vect-data-refs.c (vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Likewise. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise. (vect_create_cond_for_alias_checks): Likewise. * tree-vrp.c (extract_range_from_assert): Likewise. * config/alpha/alpha.c (alpha_va_start): Likewise. (alpha_gimplify_va_arg_1): Likewise. * config/i386/i386.c (ix86_va_start): Likewise. (ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mep/mep.c (mep_expand_va_start): Likewise. (mep_gimplify_va_arg_expr): Likewise. * config/mips/mips.c (mips_va_start): Likewise. (mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start): Likewise. (rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start): Likewise. (s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start): Likewise. (sh_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Likewise. (spu_gimplify_va_arg_expr): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. (xstormy16_gimplify_va_arg_expr): Likewise. * config/xtensa/xtensa.c (xtensa_va_start): Likewise. (xtensa_gimplify_va_arg_expr): Likewise. c-family/ * c-common.c (pointer_int_sum): Use fold_build_pointer_plus. * c-omp.c (c_finish_omp_for): Likewise. cp/ * call.c (build_special_member_call): Use fold_build_pointer_plus. * class.c (build_base_path): Likewise. (convert_to_base_statically): Likewise. (dfs_accumulate_vtbl_inits): Likewise. * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise. * except.c (expand_start_catch_block): Likewise. * init.c (expand_virtual_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * rtti.c (build_headof): Likewise. (tinfo_base_init): Likewise. * typeck.c (get_member_function_from_ptrfunc): Likewise. (cp_build_addr_expr_1): Likewise. * typeck2.c (build_m_component_ref): Likewise. fortran/ * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus. (gfc_trans_string_copy): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. * trans.c (gfc_build_array_ref): Likewise. java/ * builtins.c (static): Use fold_build_pointer_plus. * class.c (make_class_data): Likewise. (build_symbol_entry): Likewise. * except.c (build_exception_object_ref): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. objc/ * objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref): Use fold_build_pointer_plus. (objc2_build_ehtype_initializer): Likewise. From-SVN: r176461
2011-07-19 16:01:59 +02:00
tmp = fold_build_pointer_plus (unshare_expr (next_fp_tmp), tmp);
gimplify_assign (unshare_expr (next_fp_tmp), tmp, pre_p);
}
if (is_double)
gimplify_and_add (cmp, pre_p);
#ifdef FUNCTION_ARG_SCmode_WART
if (TYPE_MODE (eff_type) == SCmode
&& TARGET_SH4 && TARGET_LITTLE_ENDIAN)
{
tree subtype = TREE_TYPE (eff_type);
tree real, imag;
imag
= std_gimplify_va_arg_expr (next_fp_tmp, subtype, pre_p, NULL);
imag = get_initialized_tmp_var (imag, pre_p, NULL);
real
= std_gimplify_va_arg_expr (next_fp_tmp, subtype, pre_p, NULL);
real = get_initialized_tmp_var (real, pre_p, NULL);
result = build2 (COMPLEX_EXPR, eff_type, real, imag);
if (type != eff_type)
result = build1 (VIEW_CONVERT_EXPR, type, result);
result = get_initialized_tmp_var (result, pre_p, NULL);
}
#endif /* FUNCTION_ARG_SCmode_WART */
tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_false));
gimplify_and_add (tmp, pre_p);
tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_stack));
gimplify_assign (unshare_expr (addr), tmp, pre_p);
gimplify_assign (unshare_expr (next_fp_tmp),
unshare_expr (valist), pre_p);
gimplify_assign (unshare_expr (valist),
unshare_expr (next_fp_tmp), post_p);
valist = next_fp_tmp;
}
else
{
tree.h (fold_build_pointer_plus_loc): New helper function. 2011-07-19 Richard Guenther <rguenther@suse.de> * tree.h (fold_build_pointer_plus_loc): New helper function. (fold_build_pointer_plus_hwi_loc): Likewise. (fold_build_pointer_plus): Define. (fold_build_pointer_plus_hwi): Likewise. * builtins.c (std_gimplify_va_arg_expr): Use fold_build_pointer_plus. (fold_builtin_memory_op): Likewise. (fold_builtin_stpcpy): Likewise. (fold_builtin_memchr): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. * c-typeck.c (build_unary_op): Likewise. * cgraphunit.c (thunk_adjust): Likewise. * fold-const.c (build_range_check): Likewise. (fold_binary_loc): Likewise. * omp-low.c (extract_omp_for_data): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_for_static_chunk): Likewise. * tree-affine.c (add_elt_to_tree): Likewise. * tree-data-ref.c (split_constant_offset_1): Likewise. * tree-loop-distribution.c (generate_memset_zero): Likewise. * tree-mudflap.c (mf_xform_derefs_1): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): Likewise. (add_to_parts): Likewise. (create_mem_ref): Likewise. * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Likewise. (number_of_iterations_le): Likewise. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Likewise. * tree-vect-data-refs.c (vect_analyze_data_refs): Likewise. (vect_create_addr_base_for_vector_ref): Likewise. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Likewise. (vect_create_cond_for_alias_checks): Likewise. * tree-vrp.c (extract_range_from_assert): Likewise. * config/alpha/alpha.c (alpha_va_start): Likewise. (alpha_gimplify_va_arg_1): Likewise. * config/i386/i386.c (ix86_va_start): Likewise. (ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mep/mep.c (mep_expand_va_start): Likewise. (mep_gimplify_va_arg_expr): Likewise. * config/mips/mips.c (mips_va_start): Likewise. (mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start): Likewise. (rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start): Likewise. (s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start): Likewise. (sh_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Likewise. (spu_gimplify_va_arg_expr): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. (xstormy16_gimplify_va_arg_expr): Likewise. * config/xtensa/xtensa.c (xtensa_va_start): Likewise. (xtensa_gimplify_va_arg_expr): Likewise. c-family/ * c-common.c (pointer_int_sum): Use fold_build_pointer_plus. * c-omp.c (c_finish_omp_for): Likewise. cp/ * call.c (build_special_member_call): Use fold_build_pointer_plus. * class.c (build_base_path): Likewise. (convert_to_base_statically): Likewise. (dfs_accumulate_vtbl_inits): Likewise. * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise. * except.c (expand_start_catch_block): Likewise. * init.c (expand_virtual_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * rtti.c (build_headof): Likewise. (tinfo_base_init): Likewise. * typeck.c (get_member_function_from_ptrfunc): Likewise. (cp_build_addr_expr_1): Likewise. * typeck2.c (build_m_component_ref): Likewise. fortran/ * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus. (gfc_trans_string_copy): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. * trans.c (gfc_build_array_ref): Likewise. java/ * builtins.c (static): Use fold_build_pointer_plus. * class.c (make_class_data): Likewise. (build_symbol_entry): Likewise. * except.c (build_exception_object_ref): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. objc/ * objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref): Use fold_build_pointer_plus. (objc2_build_ehtype_initializer): Likewise. From-SVN: r176461
2011-07-19 16:01:59 +02:00
tmp = fold_build_pointer_plus_hwi (unshare_expr (next_o), rsize);
tmp = build2 (GT_EXPR, boolean_type_node, tmp,
unshare_expr (next_o_limit));
tmp = build3 (COND_EXPR, void_type_node, tmp,
build1 (GOTO_EXPR, void_type_node,
unshare_expr (lab_false)),
NULL_TREE);
gimplify_and_add (tmp, pre_p);
tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_o));
gimplify_assign (unshare_expr (addr), tmp, pre_p);
tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_false));
gimplify_and_add (tmp, pre_p);
if (size > 4 && ! (TARGET_SH4 || TARGET_SH2A))
gimplify_assign (unshare_expr (next_o),
unshare_expr (next_o_limit), pre_p);
tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_stack));
gimplify_assign (unshare_expr (addr), tmp, pre_p);
}
if (!result)
{
tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
}
}
/* ??? In va-sh.h, there had been code to make values larger than
size 8 indirect. This does not match the FUNCTION_ARG macros. */
tmp = std_gimplify_va_arg_expr (valist, type, pre_p, NULL);
if (result)
{
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 (result, tmp, pre_p);
result = build1 (NOP_EXPR, TREE_TYPE (result), result);
tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
}
else
result = tmp;
if (pass_by_ref)
result = build_va_arg_indirect_ref (result);
return result;
}
/* 64 bit floating points memory transfers are paired single precision loads
or store. So DWARF information needs fixing in little endian (unless
PR=SZ=1 in FPSCR). */
rtx
sh_dwarf_register_span (rtx reg)
{
unsigned regno = REGNO (reg);
if (WORDS_BIG_ENDIAN || GET_MODE (reg) != DFmode)
return NULL_RTX;
return
gen_rtx_PARALLEL (VOIDmode,
gen_rtvec (2,
gen_rtx_REG (SFmode, regno + 1),
gen_rtx_REG (SFmode, regno)));
}
static enum machine_mode
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
sh_promote_function_mode (const_tree type, enum machine_mode mode,
int *punsignedp, const_tree funtype,
int for_return)
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
{
if (sh_promote_prototypes (funtype))
return promote_mode (type, mode, punsignedp);
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
else
return default_promote_function_mode (type, mode, punsignedp, funtype,
for_return);
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
}
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
sh_promote_prototypes (const_tree type)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
if (TARGET_HITACHI)
return false;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (! type)
return true;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
return ! sh_attr_renesas_p (type);
}
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
/* Whether an argument must be passed by reference. On SHcompact, we
pretend arguments wider than 32-bits that would have been passed in
registers are passed by reference, so that an SHmedia trampoline
loads them into the full 64-bits registers. */
static 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
shcompact_byref (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named)
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
{
unsigned HOST_WIDE_INT size;
if (type)
size = int_size_in_bytes (type);
else
size = GET_MODE_SIZE (mode);
if (cum->arg_count[SH_ARG_INT] < NPARM_REGS (SImode)
&& (!named
|| GET_SH_ARG_CLASS (mode) == SH_ARG_INT
|| (GET_SH_ARG_CLASS (mode) == SH_ARG_FLOAT
&& cum->arg_count[SH_ARG_FLOAT] >= NPARM_REGS (SFmode)))
&& size > 4
&& !SHCOMPACT_FORCE_ON_STACK (mode, type)
&& !SH5_WOULD_BE_PARTIAL_NREGS (*cum, mode, type, named))
return size;
else
return 0;
}
static bool
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_pass_by_reference (cumulative_args_t cum_v, enum machine_mode 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
const_tree type, bool named)
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
{
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
if (targetm.calls.must_pass_in_stack (mode, type))
return true;
/* ??? std_gimplify_va_arg_expr passes NULL for cum. That function
wants to know about pass-by-reference semantics for incoming
arguments. */
if (! cum)
return false;
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
if (TARGET_SHCOMPACT)
{
cum->byref = shcompact_byref (cum, mode, type, named);
return cum->byref != 0;
}
return false;
}
function.c (reference_callee_copied): New. * function.c (reference_callee_copied): New. (assign_parm_setup_reg): Use it. * calls.c (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.h (reference_callee_copied): Declare. * target.h (struct gcc_target): Add callee_copies. * target-def.h (TARGET_CALLEE_COPIES): New. (TARGET_PASS_BY_REFERENCE): Update default. * expr.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * targhooks.c (hook_callee_copies_named): New. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Rename from hook_pass_by_reference_false. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): New. * targhooks.h: Update decls. * config/arc/arc.c (TARGET_CALLEE_COPIES): New. * config/arc/arc.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/frv/frv-protos.h (frv_function_arg_callee_copies): Remove. * config/frv/frv.c (frv_function_arg_callee_copies): Remove. * config/frv/frv.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/iq2000/iq2000.c (TARGET_CALLEE_COPIES): New. * config/iq2000/iq2000.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/m68hc11/m68hc11.c (TARGET_CALLEE_COPIES): New. * config/m68hc11/m68hc11.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mips/mips.c (TARGET_CALLEE_COPIES): New. (mips_callee_copies): New. * config/mips/mips.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): New. * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): New. * config/mn10300/mn10300.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/pa/pa.c (TARGET_CALLEE_COPIES): New. * config/pa/pa.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/sh/sh.c (sh_callee_copies): New. (TARGET_CALLEE_COPIES): New. * config/sh/sh.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/v850/v850.c (TARGET_CALLEE_COPIES): New. * config/v850/v850.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * doc/tm.texi (TARGET_CALLEE_COPIES): Replace documentation for FUNCTION_ARG_CALLEE_COPIES. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Update. From-SVN: r87195
2004-09-08 20:45:21 +02:00
static bool
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_callee_copies (cumulative_args_t cum, enum machine_mode 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
const_tree type, bool named ATTRIBUTE_UNUSED)
function.c (reference_callee_copied): New. * function.c (reference_callee_copied): New. (assign_parm_setup_reg): Use it. * calls.c (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.h (reference_callee_copied): Declare. * target.h (struct gcc_target): Add callee_copies. * target-def.h (TARGET_CALLEE_COPIES): New. (TARGET_PASS_BY_REFERENCE): Update default. * expr.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * targhooks.c (hook_callee_copies_named): New. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Rename from hook_pass_by_reference_false. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): New. * targhooks.h: Update decls. * config/arc/arc.c (TARGET_CALLEE_COPIES): New. * config/arc/arc.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/frv/frv-protos.h (frv_function_arg_callee_copies): Remove. * config/frv/frv.c (frv_function_arg_callee_copies): Remove. * config/frv/frv.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/iq2000/iq2000.c (TARGET_CALLEE_COPIES): New. * config/iq2000/iq2000.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/m68hc11/m68hc11.c (TARGET_CALLEE_COPIES): New. * config/m68hc11/m68hc11.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mips/mips.c (TARGET_CALLEE_COPIES): New. (mips_callee_copies): New. * config/mips/mips.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): New. * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): New. * config/mn10300/mn10300.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/pa/pa.c (TARGET_CALLEE_COPIES): New. * config/pa/pa.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/sh/sh.c (sh_callee_copies): New. (TARGET_CALLEE_COPIES): New. * config/sh/sh.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/v850/v850.c (TARGET_CALLEE_COPIES): New. * config/v850/v850.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * doc/tm.texi (TARGET_CALLEE_COPIES): Replace documentation for FUNCTION_ARG_CALLEE_COPIES. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Update. From-SVN: r87195
2004-09-08 20:45:21 +02:00
{
/* ??? How can it possibly be correct to return true only on the
caller side of the equation? Is there someplace else in the
sh backend that's magically producing the copies? */
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
return (get_cumulative_args (cum)->outgoing
function.c (reference_callee_copied): New. * function.c (reference_callee_copied): New. (assign_parm_setup_reg): Use it. * calls.c (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.h (reference_callee_copied): Declare. * target.h (struct gcc_target): Add callee_copies. * target-def.h (TARGET_CALLEE_COPIES): New. (TARGET_PASS_BY_REFERENCE): Update default. * expr.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * targhooks.c (hook_callee_copies_named): New. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Rename from hook_pass_by_reference_false. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): New. * targhooks.h: Update decls. * config/arc/arc.c (TARGET_CALLEE_COPIES): New. * config/arc/arc.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/frv/frv-protos.h (frv_function_arg_callee_copies): Remove. * config/frv/frv.c (frv_function_arg_callee_copies): Remove. * config/frv/frv.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/iq2000/iq2000.c (TARGET_CALLEE_COPIES): New. * config/iq2000/iq2000.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/m68hc11/m68hc11.c (TARGET_CALLEE_COPIES): New. * config/m68hc11/m68hc11.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mips/mips.c (TARGET_CALLEE_COPIES): New. (mips_callee_copies): New. * config/mips/mips.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): New. * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): New. * config/mn10300/mn10300.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/pa/pa.c (TARGET_CALLEE_COPIES): New. * config/pa/pa.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/sh/sh.c (sh_callee_copies): New. (TARGET_CALLEE_COPIES): New. * config/sh/sh.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/v850/v850.c (TARGET_CALLEE_COPIES): New. * config/v850/v850.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * doc/tm.texi (TARGET_CALLEE_COPIES): Replace documentation for FUNCTION_ARG_CALLEE_COPIES. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Update. From-SVN: r87195
2004-09-08 20:45:21 +02:00
&& ((mode == BLKmode ? TYPE_ALIGN (type) : GET_MODE_ALIGNMENT (mode))
% SH_MIN_ALIGN_FOR_CALLEE_COPY == 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
static int
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_arg_partial_bytes (cumulative_args_t cum_v, enum machine_mode mode,
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
tree type, bool named ATTRIBUTE_UNUSED)
{
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
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
int words = 0;
if (!TARGET_SH5
&& PASS_IN_REG_P (*cum, mode, type)
&& !(TARGET_SH4 || TARGET_SH2A_DOUBLE)
&& (ROUND_REG (*cum, mode)
+ (mode != BLKmode
? ROUND_ADVANCE (GET_MODE_SIZE (mode))
: ROUND_ADVANCE (int_size_in_bytes (type)))
> NPARM_REGS (mode)))
words = NPARM_REGS (mode) - ROUND_REG (*cum, mode);
else if (!TARGET_SHCOMPACT
&& SH5_WOULD_BE_PARTIAL_NREGS (*cum, mode, type, named))
words = NPARM_REGS (SImode) - cum->arg_count[SH_ARG_INT];
return words * UNITS_PER_WORD;
}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
/* Define where to put the arguments to a function.
Value is zero to push the argument on the stack,
or a hard register in which to store the argument.
MODE is the argument's machine mode.
TYPE is the data type of the argument (as a tree).
This is null for libcalls where that information may
not be available.
CUM is a variable of type CUMULATIVE_ARGS which gives info about
the preceding args and about the function being called.
NAMED is nonzero if this argument is a named parameter
(otherwise it is an extra parameter matching an ellipsis).
On SH the first args are normally in registers
and the rest are pushed. Any arg that starts within the first
NPARM_REGS words is at least partially passed in a register unless
its data type forbids. */
static rtx
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_function_arg (cumulative_args_t ca_v, enum machine_mode mode,
const_tree type, bool named)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v);
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (! TARGET_SH5 && mode == VOIDmode)
return GEN_INT (ca->renesas_abi ? 1 : 0);
if (! TARGET_SH5
&& PASS_IN_REG_P (*ca, mode, type)
&& (named || ! (TARGET_HITACHI || ca->renesas_abi)))
{
int regno;
if (mode == SCmode && TARGET_SH4 && TARGET_LITTLE_ENDIAN
&& (! FUNCTION_ARG_SCmode_WART || (ROUND_REG (*ca, mode) & 1)))
{
rtx r1 = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (SFmode,
BASE_ARG_REG (mode)
+ (ROUND_REG (*ca, mode) ^ 1)),
const0_rtx);
rtx r2 = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (SFmode,
BASE_ARG_REG (mode)
+ ((ROUND_REG (*ca, mode) + 1) ^ 1)),
GEN_INT (4));
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
return gen_rtx_PARALLEL(SCmode, gen_rtvec(2, r1, r2));
}
/* If the alignment of a DF value causes an SF register to be
skipped, we will use that skipped register for the next SF
value. */
if ((TARGET_HITACHI || ca->renesas_abi)
&& ca->free_single_fp_reg
&& mode == SFmode)
return gen_rtx_REG (mode, ca->free_single_fp_reg);
regno = (BASE_ARG_REG (mode) + ROUND_REG (*ca, mode))
^ (mode == SFmode && TARGET_SH4
&& TARGET_LITTLE_ENDIAN
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
&& ! TARGET_HITACHI && ! ca->renesas_abi);
return gen_rtx_REG (mode, regno);
}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (TARGET_SH5)
{
if (mode == VOIDmode && TARGET_SHCOMPACT)
return GEN_INT (ca->call_cookie);
/* The following test assumes unnamed arguments are promoted to
DFmode. */
if (mode == SFmode && ca->free_single_fp_reg)
return SH5_PROTOTYPED_FLOAT_ARG (*ca, mode, ca->free_single_fp_reg);
if ((GET_SH_ARG_CLASS (mode) == SH_ARG_FLOAT)
&& (named || ! ca->prototype_p)
&& ca->arg_count[(int) SH_ARG_FLOAT] < NPARM_REGS (SFmode))
{
if (! ca->prototype_p && TARGET_SHMEDIA)
return SH5_PROTOTYPELESS_FLOAT_ARG (*ca, mode);
return SH5_PROTOTYPED_FLOAT_ARG (*ca, mode,
FIRST_FP_PARM_REG
+ ca->arg_count[(int) SH_ARG_FLOAT]);
}
if (ca->arg_count[(int) SH_ARG_INT] < NPARM_REGS (SImode)
&& (! TARGET_SHCOMPACT
|| (! SHCOMPACT_FORCE_ON_STACK (mode, type)
&& ! SH5_WOULD_BE_PARTIAL_NREGS (*ca, mode,
type, named))))
{
return gen_rtx_REG (mode, (FIRST_PARM_REG
+ ca->arg_count[(int) SH_ARG_INT]));
}
return NULL_RTX;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
}
return NULL_RTX;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be
available.) */
static void
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_function_arg_advance (cumulative_args_t ca_v, enum machine_mode mode,
const_tree type, bool named)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v);
if (ca->force_mem)
ca->force_mem = 0;
else if (TARGET_SH5)
{
const_tree type2 = (ca->byref && type
? TREE_TYPE (type)
: type);
enum machine_mode mode2 = (ca->byref && type
? TYPE_MODE (type2)
: mode);
int dwords = ((ca->byref
? ca->byref
: mode2 == BLKmode
? int_size_in_bytes (type2)
: GET_MODE_SIZE (mode2)) + 7) / 8;
int numregs = MIN (dwords, NPARM_REGS (SImode)
- ca->arg_count[(int) SH_ARG_INT]);
if (numregs)
{
ca->arg_count[(int) SH_ARG_INT] += numregs;
if (TARGET_SHCOMPACT
&& SHCOMPACT_FORCE_ON_STACK (mode2, type2))
{
ca->call_cookie
|= CALL_COOKIE_INT_REG (ca->arg_count[(int) SH_ARG_INT]
- numregs, 1);
/* N.B. We want this also for outgoing. */
ca->stack_regs += numregs;
}
else if (ca->byref)
{
if (! ca->outgoing)
ca->stack_regs += numregs;
ca->byref_regs += numregs;
ca->byref = 0;
do
ca->call_cookie
|= CALL_COOKIE_INT_REG (ca->arg_count[(int) SH_ARG_INT]
- numregs, 2);
while (--numregs);
ca->call_cookie
|= CALL_COOKIE_INT_REG (ca->arg_count[(int) SH_ARG_INT]
- 1, 1);
}
else if (dwords > numregs)
{
int pushregs = numregs;
if (TARGET_SHCOMPACT)
ca->stack_regs += numregs;
while (pushregs < NPARM_REGS (SImode) - 1
&& (CALL_COOKIE_INT_REG_GET
(ca->call_cookie,
NPARM_REGS (SImode) - pushregs)
== 1))
{
ca->call_cookie
&= ~ CALL_COOKIE_INT_REG (NPARM_REGS (SImode)
- pushregs, 1);
pushregs++;
}
if (numregs == NPARM_REGS (SImode))
ca->call_cookie
|= CALL_COOKIE_INT_REG (0, 1)
| CALL_COOKIE_STACKSEQ (numregs - 1);
else
ca->call_cookie
|= CALL_COOKIE_STACKSEQ (numregs);
}
}
if (GET_SH_ARG_CLASS (mode2) == SH_ARG_FLOAT
&& (named || ! ca->prototype_p))
{
if (mode2 == SFmode && ca->free_single_fp_reg)
ca->free_single_fp_reg = 0;
else if (ca->arg_count[(int) SH_ARG_FLOAT]
< NPARM_REGS (SFmode))
{
int numfpregs
= MIN ((GET_MODE_SIZE (mode2) + 7) / 8 * 2,
NPARM_REGS (SFmode)
- ca->arg_count[(int) SH_ARG_FLOAT]);
ca->arg_count[(int) SH_ARG_FLOAT] += numfpregs;
if (TARGET_SHCOMPACT && ! ca->prototype_p)
{
if (ca->outgoing && numregs > 0)
do
{
ca->call_cookie
|= (CALL_COOKIE_INT_REG
(ca->arg_count[(int) SH_ARG_INT]
- numregs + ((numfpregs - 2) / 2),
4 + (ca->arg_count[(int) SH_ARG_FLOAT]
- numfpregs) / 2));
}
while (numfpregs -= 2);
}
else if (mode2 == SFmode && (named)
&& (ca->arg_count[(int) SH_ARG_FLOAT]
< NPARM_REGS (SFmode)))
ca->free_single_fp_reg
= FIRST_FP_PARM_REG - numfpregs
+ ca->arg_count[(int) SH_ARG_FLOAT] + 1;
}
}
return;
}
if ((TARGET_HITACHI || ca->renesas_abi) && TARGET_FPU_DOUBLE)
{
/* Note that we've used the skipped register. */
if (mode == SFmode && ca->free_single_fp_reg)
{
ca->free_single_fp_reg = 0;
return;
}
/* When we have a DF after an SF, there's an SF register that get
skipped in order to align the DF value. We note this skipped
register, because the next SF value will use it, and not the
SF that follows the DF. */
if (mode == DFmode
&& ROUND_REG (*ca, DFmode) != ROUND_REG (*ca, SFmode))
{
ca->free_single_fp_reg = (ROUND_REG (*ca, SFmode)
+ BASE_ARG_REG (mode));
}
}
Introduce sh2a support. 2004-07-29 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Build multilibs for sh2a and sh2a-single by default. * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by default. Split their tests out of the corresponding SH4 multilibs. * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a multilibs for SH2a. 2004-07-28 Alexandre Oliva <aoliva@redhat.com> * config.gcc: Handle sh2a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh2a command line flags. * config/sh/t-mlib-sh2a: New. * config/sh/t-mlib-sh2a-nofpu: New. * config/sh/t-mlib-sh2a-single: New. * config/sh/t-mlib-sh2a-single-only: New. 2004-07-09 Nick Clifton <nickc@redhat.com> Issue 43400 * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if -ml and -m2a are used together. 2004-03-23 DJ Delorie <dj@redhat.com> * config/sh/sh.c (sh_builtin_saveregs): Use the double code only when we have a double-sized FPU. 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ is set. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, -msh2a-single and -msh2a-single-only 2004-02-24 Corinna Vinschen <vinschen@redhat.com> * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ is set. 2004-02-20 DJ Delorie <dj@delorie.com> * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. 2004-02-20 Fred Fish <fnf@redhat.com>, Corinna Vinschen <vinschen@redhat.com> * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. 2004-02-18 DJ Delorie <dj@redhat.com> * config/sh/sh.c (broken_move): Add support for movi20. * config/sh/sh.h: Likewise. (SHIFT_COUNT_TRUNCATED): Set for sh2a. * config/sh/sh.md (udivsi3_sh2a): New. (udivsi3): Call it. (divsi3_sh2a): New. (divsi3): Call it. (mul_r): New. (ashlsi3_sh2a): New. (ashrsi3_sh2a): New. (lshrsi3_sh2a): New. (movsi_i): Disable for sh2a. (movsi_ie): Add movi20. (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable sh2a, for -m2a-nofpu mode. 2004-02-13 DJ Delorie <dj@redhat.com> * config/sh/lib1funcs.asm: Handle double vs single better. * config/sh/sh.h: Likewise. 2004-02-09 DJ Delorie <dj@redhat.com> * config/sh/crt1.asm: Add support for sh2a. * config/sh/elf.h: Likewise. * config/sh/lib1funcs.asm: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh.md: Likewise. * config/sh/sh.h: Likewise. * config/sh/t-sh: Likewise. From-SVN: r85286
2004-07-29 08:10:03 +02:00
if (! ((TARGET_SH4 || TARGET_SH2A) || ca->renesas_abi)
|| PASS_IN_REG_P (*ca, mode, type))
(ca->arg_count[(int) GET_SH_ARG_CLASS (mode)]
= (ROUND_REG (*ca, mode)
+ (mode == BLKmode
? ROUND_ADVANCE (int_size_in_bytes (type))
: ROUND_ADVANCE (GET_MODE_SIZE (mode)))));
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
}
/* The Renesas calling convention doesn't quite fit into this scheme since
the address is passed like an invisible argument, but one that is always
passed in memory. */
static rtx
sh_struct_value_rtx (tree fndecl, int incoming ATTRIBUTE_UNUSED)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
if (TARGET_HITACHI || sh_attr_renesas_p (fndecl))
return NULL_RTX;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
return gen_rtx_REG (Pmode, 2);
}
/* Worker function for TARGET_FUNCTION_VALUE.
For the SH, this is like LIBCALL_VALUE, except that we must change the
mode like PROMOTE_MODE does.
??? PROMOTE_MODE is ignored for non-scalar types. The set of types
tested here has to be kept in sync with the one in explow.c:promote_mode.
*/
static rtx
sh_function_value (const_tree valtype,
const_tree fn_decl_or_type,
bool outgoing ATTRIBUTE_UNUSED)
{
if (fn_decl_or_type
&& !DECL_P (fn_decl_or_type))
fn_decl_or_type = NULL;
return gen_rtx_REG (
((GET_MODE_CLASS (TYPE_MODE (valtype)) == MODE_INT
&& GET_MODE_SIZE (TYPE_MODE (valtype)) < 4
&& (TREE_CODE (valtype) == INTEGER_TYPE
|| TREE_CODE (valtype) == ENUMERAL_TYPE
|| TREE_CODE (valtype) == BOOLEAN_TYPE
|| TREE_CODE (valtype) == REAL_TYPE
|| TREE_CODE (valtype) == OFFSET_TYPE))
&& sh_promote_prototypes (fn_decl_or_type)
? (TARGET_SHMEDIA64 ? DImode : SImode) : TYPE_MODE (valtype)),
BASE_RETURN_VALUE_REG (TYPE_MODE (valtype)));
}
/* Worker function for TARGET_LIBCALL_VALUE. */
static rtx
sh_libcall_value (enum machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (mode, BASE_RETURN_VALUE_REG (mode));
}
/* Return true if N is a possible register number of function value. */
static bool
sh_function_value_regno_p (const unsigned int regno)
{
return ((regno) == FIRST_RET_REG
|| (TARGET_SH2E && (regno) == FIRST_FP_RET_REG)
|| (TARGET_SHMEDIA_FPU && (regno) == FIRST_FP_RET_REG));
}
/* Worker function for TARGET_RETURN_IN_MEMORY. */
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
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
sh_return_in_memory (const_tree type, const_tree fndecl)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
if (TARGET_SH5)
{
if (TYPE_MODE (type) == BLKmode)
return ((unsigned HOST_WIDE_INT) int_size_in_bytes (type)) > 8;
else
return GET_MODE_SIZE (TYPE_MODE (type)) > 8;
}
else
{
return (TYPE_MODE (type) == BLKmode
|| ((TARGET_HITACHI || sh_attr_renesas_p (fndecl))
&& TREE_CODE (type) == RECORD_TYPE));
}
}
/* We actually emit the code in sh_expand_prologue. We used to use
a static variable to flag that we need to emit this code, but that
doesn't when inlining, when functions are deferred and then emitted
later. Fortunately, we already have two flags that are part of struct
function that tell if a function uses varargs or stdarg. */
static void
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_setup_incoming_varargs (cumulative_args_t ca,
enum machine_mode mode,
tree type,
int *pretend_arg_size,
int second_time ATTRIBUTE_UNUSED)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
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
gcc_assert (cfun->stdarg);
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl))
{
int named_parm_regs, anon_parm_regs;
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
named_parm_regs = (ROUND_REG (*get_cumulative_args (ca), mode)
+ (mode == BLKmode
? ROUND_ADVANCE (int_size_in_bytes (type))
: ROUND_ADVANCE (GET_MODE_SIZE (mode))));
anon_parm_regs = NPARM_REGS (SImode) - named_parm_regs;
if (anon_parm_regs > 0)
*pretend_arg_size = anon_parm_regs * 4;
}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
}
static bool
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_strict_argument_naming (cumulative_args_t ca ATTRIBUTE_UNUSED)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
return TARGET_SH5;
}
static bool
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_pretend_outgoing_varargs_named (cumulative_args_t ca_v)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
CUMULATIVE_ARGS *ca = get_cumulative_args (ca_v);
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
return ! (TARGET_HITACHI || ca->renesas_abi) && ! TARGET_SH5;
}
/* Define the offset between two registers, one to be eliminated, and
the other its replacement, at the start of a routine. */
int
initial_elimination_offset (int from, int to)
{
int regs_saved;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
int regs_saved_rounding = 0;
int total_saved_regs_space;
int total_auto_space;
int save_flags = target_flags;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
int copy_flags;
HARD_REG_SET live_regs_mask;
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
shmedia_space_reserved_for_target_registers = false;
regs_saved = calc_live_regs (&live_regs_mask);
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
regs_saved += SHMEDIA_REGS_STACK_ADJUST ();
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
if (shmedia_reserve_space_for_target_registers_p (regs_saved, &live_regs_mask))
{
shmedia_space_reserved_for_target_registers = true;
regs_saved += shmedia_target_regs_stack_adjust (&live_regs_mask);
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (TARGET_SH5 && regs_saved % (STACK_BOUNDARY / BITS_PER_UNIT))
regs_saved_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
- regs_saved % (STACK_BOUNDARY / BITS_PER_UNIT));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
total_auto_space = rounded_frame_size (regs_saved) - regs_saved_rounding;
copy_flags = target_flags;
target_flags = save_flags;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
total_saved_regs_space = regs_saved + regs_saved_rounding;
1993-06-29 02:10:35 +02:00
if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return total_saved_regs_space + total_auto_space
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->args.info.byref_regs * 8;
1995-04-21 03:19:27 +02:00
if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
return total_saved_regs_space + total_auto_space
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->args.info.byref_regs * 8;
1995-04-21 03:19:27 +02:00
/* Initial gap between fp and sp is 0. */
if (from == HARD_FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
1995-04-21 03:19:27 +02:00
return 0;
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return rounded_frame_size (0);
if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
return rounded_frame_size (0);
gcc_assert (from == RETURN_ADDRESS_POINTER_REGNUM
&& (to == HARD_FRAME_POINTER_REGNUM
|| to == STACK_POINTER_REGNUM));
if (TARGET_SH5)
{
int n = total_saved_regs_space;
int pr_reg = TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG;
save_schedule schedule;
save_entry *entry;
n += total_auto_space;
/* If it wasn't saved, there's not much we can do. */
if (! TEST_HARD_REG_BIT (live_regs_mask, pr_reg))
return n;
target_flags = copy_flags;
sh5_schedule_saves (&live_regs_mask, &schedule, n);
for (entry = &schedule.entries[1]; entry->mode != VOIDmode; entry++)
if (entry->reg == pr_reg)
{
target_flags = save_flags;
return entry->offset;
}
gcc_unreachable ();
}
else
return total_auto_space;
}
/* Parse the -mfixed-range= option string. */
void
sh_fix_range (const char *const_str)
{
int i, first, last;
char *str, *dash, *comma;
/* 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. */
i = strlen (const_str);
str = (char *) alloca (i + 1);
memcpy (str, const_str, i + 1);
while (1)
{
dash = strchr (str, '-');
if (!dash)
{
warning (0, "value of -mfixed-range must have form REG1-REG2");
return;
}
*dash = '\0';
comma = strchr (dash + 1, ',');
if (comma)
*comma = '\0';
first = decode_reg_name (str);
if (first < 0)
{
warning (0, "unknown register name: %s", str);
return;
}
last = decode_reg_name (dash + 1);
if (last < 0)
{
warning (0, "unknown register name: %s", dash + 1);
return;
}
*dash = '-';
if (first > last)
{
warning (0, "%s-%s is an empty range", str, dash + 1);
return;
}
for (i = first; i <= last; ++i)
fixed_regs[i] = call_used_regs[i] = 1;
if (!comma)
break;
*comma = ',';
str = comma + 1;
}
}
1995-04-21 03:19:27 +02:00
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
/* Insert any deferred function attributes from earlier pragmas. */
target.h (struct gcc_target): Add insert_attributes. * target.h (struct gcc_target): Add insert_attributes. * target-def.h (TARGET_INSERT_ATTRIBUTES): Define. (TARGET_INITIALIZER): Update. * tree.c, tree.h (default_insert_attributes): New function. Update comments on other default functions to refer to targetm, not target. * doc/tm.texi (INSERT_ATTRIBUTES): Update to document TARGET_INSERT_ATTRIBUTES. (SET_DEFAULT_DECL_ATTRIBUTES): Remove. * c-common.c (decl_attributes): Use targetm.insert_attributes. Don't use PRAGMA_INSERT_ATTRIBUTES. * Makefile.in (c-common.o): Depend on $(TARGET_H). * c-decl.c (start_decl, start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. * config/c4x/c4x.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. * config/c4x/c4x-protos.h (c4x_set_default_attributes): Don't declare. * config/c4x/c4x.c (TARGET_INSERT_ATTRIBUTES): Define. (c4x_check_attribute): Avoid modifying attribute list itself. (c4x_set_default_attributes): Rename to c4x_insert_attributes. Make static. * config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Don't define. * config/sh/sh-protos.h (sh_pragma_insert_attributes): Don't declare. * config/sh/sh.c (TARGET_INSERT_ATTRIBUTES): Define. (sh_pragma_insert_attributes): Rename to sh_insert_attributes. Make static. * config/v850/v850.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. * config/v850/v850-protos.h (v850_set_default_decl_attr): Don't declare. * config/v850/v850.c (TARGET_INSERT_ATTRIBUTES): Define. (v850_set_default_decl_attr): Rename to v850_insert_attributes. Adjust parameters. Make static. cp: * decl.c (start_decl): Don't call SET_DEFAULT_DECL_ATTRIBUTES. (start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. Call cplus_decl_attributes even if attrs is NULL. * friend.c (do_friend): Don't call SET_DEFAULT_DECL_ATTRIBUTES. From-SVN: r43851
2001-07-08 22:05:17 +02:00
static void
sh_insert_attributes (tree node, tree *attributes)
{
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
tree attrs;
if (TREE_CODE (node) != FUNCTION_DECL)
return;
/* We are only interested in fields. */
alias.c (find_base_decl): Remove unreachable case '3' block. 2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com> Zack Weinberg <zack@codesourcery.com> * alias.c (find_base_decl): Remove unreachable case '3' block. * expr.c (safe_from_p): Abort if passed a type. * tree-gimple.c (recalculate_side_effects): Abort if passed anything other than an expression. * tree-ssa-pre.c (phi_translate): Return expr immediately if is_gimple_min_invariant is true for it. Reorder cases for clarity. Abort on un-handled tree classes. (valid_in_set): Likewise. * tree.c (tree_code_class_strings): New static data. * tree.h (enum tree_code_class): New. (tree_code_class_strings): Declare. (TREE_CODE_CLASS_STRING, EXCEPTIONAL_CLASS_P, CONSTANT_CLASS_P) (REFERENCE_CLASS_P, COMPARISON_CLASS_P, UNARY_CLASS_P, BINARY_CLASS_P) (STATEMENT_CLASS_P, EXPRESSION_CLASS_P, IS_TYPE_OR_DECL_P): New macros. (TYPE_P, DECL_P, IS_NON_TYPE_CODE_CLASS, IS_EXPR_CODE_CLASS) (checking macros, EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_LOCUS): Update. * tree.def, c-common.def, objc/objc-tree.def: Use tree_code_class enumeration constants instead of code letters. * alias.c, builtins.c, c-common.c, c-format.c, c-lang.c, c-pragma.c * c-typeck.c, cgraphunit.c, convert.c, dbxout.c, dwarf2out.c * emit-rtl.c expr.c, fold-const.c, gimplify.c, lambda-code.c * langhooks.c, langhooks.h, predict.c, print-tree.c, reload1.c, stmt.c * tree-browser.c, tree-cfg.c, tree-chrec.c, tree-complex.c, tree-dfa.c * tree-dump.c, tree-eh.c, tree-gimple.c, tree-inline.c, tree-nested.c * tree-outof-ssa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-ccp.c * tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-forwprop.c, tree-ssa-live.c * tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c * tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c * tree-ssa.c, tree-ssanames.c, tree-tailcall.c, tree.c, varasm.c * config/sol2-c.c, config/arm/arm.c, config/i386/winnt.c * config/pa/pa.c, config/pa/pa.h, config/sh/sh.c, objc/objc-lang.c Update to match. * LANGUAGES: Add note about change. ada: * ada-tree.def: Use tree_code_class enumeration constants instead of code letters. * ada-tree.h, decl.c, misc.c, trans.c, utils.c, utils2.c: Update for new tree-class enumeration constants. cp: * cp-tree.def: Use tree_code_class enumeration constants instead of code letters. * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c * mangle.c, pt.c, semantics.c, tree.c, typeck.c: Update for new tree-class enumeration constants. fortran: * f95-lang.c, trans-expr.c, trans.c: Update for new tree-class enumeration constants. java: * java-tree.def: Use tree_code_class enumeration constants instead of code letters. * java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for new tree-class enumeration constants. treelang: * treetree.c: Update for new tree-class enumeration constants. From-SVN: r87675
2004-09-17 23:55:02 +02:00
if (!DECL_P (node))
return;
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
/* Append the attributes to the deferred attributes. */
*sh_deferred_function_attributes_tail = *attributes;
attrs = sh_deferred_function_attributes;
if (!attrs)
return;
/* Some attributes imply or require the interrupt attribute. */
if (!lookup_attribute ("interrupt_handler", attrs)
&& !lookup_attribute ("interrupt_handler", DECL_ATTRIBUTES (node)))
{
/* If we have a trapa_handler, but no interrupt_handler attribute,
insert an interrupt_handler attribute. */
if (lookup_attribute ("trapa_handler", attrs) != NULL_TREE)
/* We can't use sh_pr_interrupt here because that's not in the
java frontend. */
attrs
= tree_cons (get_identifier("interrupt_handler"), NULL_TREE, attrs);
/* However, for sp_switch, trap_exit, nosave_low_regs and resbank,
if the interrupt attribute is missing, we ignore the attribute
and warn. */
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
else if (lookup_attribute ("sp_switch", attrs)
|| lookup_attribute ("trap_exit", attrs)
|| lookup_attribute ("nosave_low_regs", attrs)
|| lookup_attribute ("resbank", attrs))
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
{
tree *tail;
for (tail = attributes; attrs; attrs = TREE_CHAIN (attrs))
{
if (is_attribute_p ("sp_switch", TREE_PURPOSE (attrs))
|| is_attribute_p ("trap_exit", TREE_PURPOSE (attrs))
|| is_attribute_p ("nosave_low_regs", TREE_PURPOSE (attrs))
|| is_attribute_p ("resbank", TREE_PURPOSE (attrs)))
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
warning (OPT_Wattributes,
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
"%qE attribute only applies to interrupt functions",
TREE_PURPOSE (attrs));
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
else
{
*tail = tree_cons (TREE_PURPOSE (attrs), NULL_TREE,
NULL_TREE);
tail = &TREE_CHAIN (*tail);
}
}
attrs = *attributes;
}
}
/* Install the processed list. */
*attributes = attrs;
/* Clear deferred attributes. */
sh_deferred_function_attributes = NULL_TREE;
sh_deferred_function_attributes_tail = &sh_deferred_function_attributes;
return;
}
/*------------------------------------------------------------------------------
Target specific attributes
Supported attributes are:
* interrupt_handler
Specifies this function is an interrupt handler.
* trapa_handler
Like interrupt_handler, but don't save all registers.
* sp_switch
Specifies an alternate stack for an interrupt handler to run on.
* trap_exit
Use a trapa to exit an interrupt function instead of rte.
* nosave_low_regs
Don't save r0..r7 in an interrupt handler function.
This is useful on SH3* and SH4*, which have a separate set of low
regs for user and privileged modes.
This is mainly to be used for non-reentrant interrupt handlers (i.e.
those that run with interrupts disabled and thus can't be
interrupted thenselves).
* renesas
Use Renesas calling/layout conventions (functions and structures).
* resbank
In case of an interrupt handler function, use a register bank to
save registers R0-R14, MACH, MACL, GBR and PR.
This is available only on SH2A targets.
* function_vector
Declares a function to be called using the TBR relative addressing
mode. Takes an argument that specifies the slot number in the table
where this function can be looked up by the JSR/N @@(disp8,TBR) insn.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
*/
/* Handle a 'resbank' attribute. */
static tree
sh_handle_resbank_handler_attribute (tree * node, tree name,
tree args ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED,
bool * no_add_attrs)
{
if (!TARGET_SH2A)
{
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 is supported only for SH2A",
name);
*no_add_attrs = true;
}
if (TREE_CODE (*node) != FUNCTION_DECL)
{
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 only applies to functions",
name);
*no_add_attrs = true;
}
return NULL_TREE;
}
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
/* Handle an "interrupt_handler" attribute; arguments as in
struct attribute_spec.handler. */
static tree
sh_handle_interrupt_handler_attribute (tree *node, tree name,
tree args ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED,
bool *no_add_attrs)
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
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
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 only applies to functions",
name);
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
*no_add_attrs = true;
}
else if (TARGET_SHCOMPACT)
{
error ("attribute interrupt_handler is not compatible with -m5-compact");
*no_add_attrs = true;
}
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
return NULL_TREE;
}
/* Handle an 'function_vector' attribute; arguments as in
struct attribute_spec.handler. */
static tree
sh2a_handle_function_vector_handler_attribute (tree * node, tree name,
tree args ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED,
bool * no_add_attrs)
{
if (!TARGET_SH2A)
{
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 only applies to SH2A",
name);
*no_add_attrs = true;
}
else if (TREE_CODE (*node) != FUNCTION_DECL)
{
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 only applies to functions",
name);
*no_add_attrs = true;
}
else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST)
{
/* The argument must be a constant integer. */
warning (OPT_Wattributes,
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
"%qE attribute argument not an integer constant",
name);
*no_add_attrs = true;
}
else if (TREE_INT_CST_LOW (TREE_VALUE (args)) > 255)
{
/* The argument value must be between 0 to 255. */
warning (OPT_Wattributes,
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
"%qE attribute argument should be between 0 to 255",
name);
*no_add_attrs = true;
}
return NULL_TREE;
}
/* Returns true if current function has been assigned the attribute
'function_vector'. */
bool
sh2a_is_function_vector_call (rtx x)
{
if (GET_CODE (x) == SYMBOL_REF
&& (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
{
tree tr = SYMBOL_REF_DECL (x);
if (sh2a_function_vector_p (tr))
return true;
}
return false;
}
/* Returns the function vector number, if the attribute
'function_vector' is assigned, otherwise returns zero. */
int
sh2a_get_function_vector_number (rtx x)
{
int num;
tree list, t;
if ((GET_CODE (x) == SYMBOL_REF)
&& (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
{
t = SYMBOL_REF_DECL (x);
if (TREE_CODE (t) != FUNCTION_DECL)
return 0;
list = SH_ATTRIBUTES (t);
while (list)
{
if (is_attribute_p ("function_vector", TREE_PURPOSE (list)))
{
num = TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (list)));
return num;
}
list = TREE_CHAIN (list);
}
return 0;
}
else
return 0;
}
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
/* Handle an "sp_switch" attribute; arguments as in
struct attribute_spec.handler. */
static tree
sh_handle_sp_switch_attribute (tree *node, tree name, tree args,
int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
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
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
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 only applies to functions",
name);
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
*no_add_attrs = true;
}
else if (TREE_CODE (TREE_VALUE (args)) != STRING_CST)
{
/* The argument must be a constant string. */
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 argument not a string constant",
name);
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
*no_add_attrs = true;
}
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
return NULL_TREE;
}
/* Handle an "trap_exit" attribute; arguments as in
struct attribute_spec.handler. */
static tree
sh_handle_trap_exit_attribute (tree *node, tree name, tree args,
int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
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
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
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 only applies to functions",
name);
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
*no_add_attrs = true;
}
re PR target/14798 (In case of SH target with -O2 option #pragma interrupt doesn't get resetted.) PR target/14798: gcc: * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. (pragma_trap, pragma_nosave_low_regs): Likewise. (current_function_anonymous_args): Likewise. (sh_deferred_function_attributes): New variable. (sh_deferred_function_attributes_tail): Likewise. (print_operand): For '@', look up trap_exit attribute. (calc_live_regs): Look up trapa_handler attribute. For trapa handlers, save/restore fpscr, but don't do any other interrupt-specific saves. Don't save r0..r7 if the nosave_low_regs attribute is in effect. Fix check for partially saved registers to check for SHmedia. (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. (sh_output_function_epilogue): Don't clear any of the removed variables. (sh_insert_attributes): Don't check pragma_interrupt. Insert deferred attributes. Check that interrupt attribute is present for other attributes that require its presence. (sh_attribute_table): Add new attributes trapa_handler and nosave_low_regs. (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): Don't check for pragma_interrupt. Don't store argument. * sh.h (pragma_interrupt, sp_switch): Don't declare. (sh_deferred_function_attributes): Declare. (sh_deferred_function_attributes_tail): Likewise. * sh.md (sp_switch_1): Add operand. Change generator caller. (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. (*return_i): Don't use when trap_exit attribute is in effect. (*return_trapa): New insn pattern. * sh-c.c: New file. * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, setting c_target_objs and cxx_target_objs. * t-sh: Add rule for sh-c.o. gcc/testsuite: * gcc.dg/pragma-isr.c: Added target sh[1234ble]*-*-*. * gcc.dg/pragma-isr2.c, gcc.dg/pragma-isr-trapa.c: New tests. * gcc.dg/pragma-isr-trapa2.c: Likewise. * gcc.dg/pragma-isr-nosave_low_regs.c: Likewise. * gcc.dg/pragma-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr.c, gcc.dg/attr-isr-trapa.c: Likewise. * gcc.dg/attr-isr-trap_exit.c: Likewise. * gcc.dg/attr-isr-nosave_low_regs.c: Likewise. From-SVN: r110398
2006-01-30 16:07:43 +01:00
/* The argument specifies a trap number to be used in a trapa instruction
at function exit (instead of an rte instruction). */
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
else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST)
{
/* The argument must be a constant integer. */
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 argument not an "
"integer constant", name);
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
*no_add_attrs = true;
}
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
return NULL_TREE;
}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
static tree
sh_handle_renesas_attribute (tree *node ATTRIBUTE_UNUSED,
tree name ATTRIBUTE_UNUSED,
tree args ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED,
bool *no_add_attrs ATTRIBUTE_UNUSED)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
return NULL_TREE;
}
/* True if __attribute__((renesas)) or -mrenesas. */
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
sh_attr_renesas_p (const_tree td)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
if (TARGET_HITACHI)
return true;
if (td == NULL_TREE)
return false;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (DECL_P (td))
td = TREE_TYPE (td);
if (td == error_mark_node)
return false;
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
return (lookup_attribute ("renesas", TYPE_ATTRIBUTES (td))
!= NULL_TREE);
}
/* True if __attribute__((renesas)) or -mrenesas, for the current
function. */
bool
sh_cfun_attr_renesas_p (void)
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
{
return sh_attr_renesas_p (current_function_decl);
}
bool
sh_cfun_interrupt_handler_p (void)
{
return (lookup_attribute ("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE);
}
/* Returns true if FUNC has been assigned the attribute
"function_vector". */
bool
sh2a_function_vector_p (tree func)
{
tree list;
if (TREE_CODE (func) != FUNCTION_DECL)
return false;
list = SH_ATTRIBUTES (func);
while (list)
{
if (is_attribute_p ("function_vector", TREE_PURPOSE (list)))
return true;
list = TREE_CHAIN (list);
}
return false;
}
/* Returns TRUE if given tree has the "resbank" attribute. */
bool
sh_cfun_resbank_handler_p (void)
{
return ((lookup_attribute ("resbank",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE)
&& (lookup_attribute ("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE) && TARGET_SH2A);
}
/* Returns true if the current function has a "trap_exit" attribute set. */
bool
sh_cfun_trap_exit_p (void)
{
return lookup_attribute ("trap_exit", DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE;
}
/* Implement TARGET_CHECK_PCH_TARGET_FLAGS. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
static const char *
sh_check_pch_target_flags (int old_flags)
{
config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config/sh/sh.h: Update mask names throughout. (target_flags, ISIZE_BIT, DALIGN_BIT, SH1_BIT, SH2_BIT, SH3_BIT) (SH_E_BIT, HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, SH4A_BIT, FMOVD_BIT) (SH5_BIT, SPACE_BIT, BIGTABLE_BIT, RELAX_BIT, USERMODE_BIT) (HITACHI_BIT, NOMACSAVE_BIT, PREFERGOT_BIT, PADSTRUCT_BIT) (LITTLE_ENDIAN_BIT, IEEE_BIT, SAVE_ALL_TR_BIT, HARD_SH2A_BIT) (HARD_SH2A_DOUBLE_BIT, INDEXED_ADDRESS_BIT, PT_FIXED_BIT) (INVALID_SYMBOLS_BIT, ADJUST_UNROLL_BIT, TARGET_DUMPISIZE) (TARGET_ALIGN_DOUBLE, TARGET_SH1, TARGET_SH2, TARGET_SH3) (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH5, TARGET_FMOVD) (TARGET_IEEE, TARGET_SMALLCODE, TARGET_BIGTABLE, TARGET_RELAX) (TARGET_HITACHI, TARGET_NOMACSAVE, TARGET_PADSTRUCT) (TARGET_LITTLE_ENDIAN, TARGET_USERMODE, TARGET_PREFERGOT) (TARGET_SAVE_ALL_TARGET_REGS, TARGET_ALLOW_INDEXED_ADDRESS) (TARGET_PT_FIXED, TARGET_INVALID_SYMBOLS, TARGET_ADJUST_UNROLL) (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E) (TARGET_SWITCH_SH2A, TARGET_SWITCH_SH2A_SINGLE_ONLY) (TARGET_SWITCH_SH2A_SINGLE, TARGET_SWITCH_SH2A_NOFPU) (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E, TARGET_SWITCH_SH4_SINGLE_ONLY) (TARGET_SWITCH_SH4_SINGLE, TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4) (TARGET_SWITCH_SH4A, TARGET_SWITCH_SH4A_SINGLE_ONLY) (TARGET_SWITCH_SH4A_SINGLE, TARGET_SWITCH_SH4A_NOFPU) (TARGET_SWITCH_SH4AL, TARGET_SWITCH_SH5_64MEDIA) (TARGET_SWITCH_SH5_64MEDIA_NOFPU, TARGET_SWITCHES_SH5_32MEDIA) (TARGET_SWITCHES_SH5_32MEDIA_NOFPU, TARGET_SWITCH_SH5_32_ANY_EXTRA) (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA, TARGET_SWITCHES) (SUBTARGET_SWITCHES): Delete. (TARGET_SH2E, TARGET_SH2A, TARGET_SH2A_SINGLE, TARGET_SH2A_DOUBLE) (TARGET_SH3E, TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARVARD) (TARGET_FPU_DOUBLE, TARGET_SH4A_ARCH, TARGET_SHMEDIA32) (TARGET_SHMEDIA64): Redefine using other TARGET_* macros. (TARGET_SH4): Undefine options.h definition and check MASK_SH1 as well. (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4, SUPPORT_SH4_SINGLE) (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Make numeric. (SUPPORT_SH2): Define to 1 if SUPPORT_SH1. (SUPPORT_SH3): Likewise SUPPORT_SH2. (SUPPORT_SH4_NOFPU): Likewise SUPPORT_SH3. (SUPPORT_SH4A_NOFPU, SUPPORT_SH4AL, SUPPORT_SH2A_NOFPU): Likewise SUPPORT_SH4_NOFPU. (SUPPORT_SH3E): Likewise SUPPORT_SH2E. (SUPPORT_SH4_SINGLE_ONLY, SUPPORT_SH4A_SINGLE_ONLY) (SUPPORT_SH2A_SINGLE_ONLY): Likewise SUPPORT_SH3E. (SUPPORT_SH4A): Likewise SUPPORT_SH4. (SUPPORT_SH4A_SINGLE): Likewise SUPPORT_SH4_SINGLE. (SUPPORT_SH5_32MEDIA): Likewise SUPPORT_SH5_COMPACT. (SUPPORT_SH5_32MEDIA_NOFPU): Likewise SUPPORT_SH5_COMPACT_NOFPU. (SUPPORT_ANY_SH5_32MEDIA, SUPPORT_ANY_SH5_64MEDIA) (SUPPORT_ANY_SH5): New macros. (TARGET_NONE): Replace with... (MASK_ARCH): ...this new macro. * config/sh/elf.h: Update mask names * config/sh/linux.h: Likewise. * config/sh/little.h: Likewise. * config/sh/netbsd-elf.h: Likewise. * config/sh/symbian-pre.h: Likewise. * config/sh/sh.c (sh_handle_option): New function. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. (calc_live_regs): Use MASK_FPU_SINGLE instead of FPU_SINGLE_BIT. (sh_target_switches, target_switches): Delete. (sh_pch_valid_p): Check for specific differences in the target_flags settings. (sh_init_cumulative_args): Use MASK_HITACHI instead of HITACHI_BIT. * config/sh/sh.opt: New file. From-SVN: r99916
2005-05-18 20:43:53 +02:00
if ((old_flags ^ target_flags) & (MASK_SH1 | MASK_SH2 | MASK_SH3
| MASK_SH_E | MASK_HARD_SH4
| MASK_FPU_SINGLE | MASK_SH4))
return _("created and used with different architectures / ABIs");
if ((old_flags ^ target_flags) & MASK_HITACHI)
return _("created and used with different ABIs");
if ((old_flags ^ target_flags) & MASK_LITTLE_ENDIAN)
return _("created and used with different endianness");
return NULL;
}
1995-04-21 03:19:27 +02:00
/* Predicates used by the templates. */
/* Returns true if OP is MACL, MACH or PR. The input must be a REG rtx.
1995-04-21 03:19:27 +02:00
Used only in general_movsrc_operand. */
bool
system_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
1995-04-21 03:19:27 +02:00
switch (REGNO (op))
{
1995-04-21 03:19:27 +02:00
case PR_REG:
case MACL_REG:
case MACH_REG:
return true;
}
return false;
}
/* Returns true if OP is a floating point value with value 0.0. */
bool
fp_zero_operand (rtx op)
{
REAL_VALUE_TYPE r;
if (GET_MODE (op) != SFmode)
return false;
REAL_VALUE_FROM_CONST_DOUBLE (r, op);
return REAL_VALUES_EQUAL (r, dconst0) && ! REAL_VALUE_MINUS_ZERO (r);
}
/* Returns true if OP is a floating point value with value 1.0. */
bool
fp_one_operand (rtx op)
{
REAL_VALUE_TYPE r;
if (GET_MODE (op) != SFmode)
return false;
REAL_VALUE_FROM_CONST_DOUBLE (r, op);
return REAL_VALUES_EQUAL (r, dconst1);
}
/* In general mode switching is used. If we are
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
compiling without -mfmovd, movsf_ie isn't taken into account for
mode switching. We could check in machine_dependent_reorg for
cases where we know we are in single precision mode, but there is
interface to find that out during reload, so we must avoid
choosing an fldi alternative during reload and thus failing to
allocate a scratch register for the constant loading. */
bool
fldi_ok (void)
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
{
return true;
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
}
/* Return the TLS type for TLS symbols, 0 for otherwise. */
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_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != SYMBOL_REF)
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
return TLS_MODEL_NONE;
return SYMBOL_REF_TLS_MODEL (op);
}
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
/* Return the destination address of a branch. */
static int
branch_dest (rtx branch)
{
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
rtx dest = SET_SRC (PATTERN (branch));
int dest_uid;
if (GET_CODE (dest) == IF_THEN_ELSE)
dest = XEXP (dest, 1);
dest = XEXP (dest, 0);
dest_uid = INSN_UID (dest);
return INSN_ADDRESSES (dest_uid);
}
/* Return nonzero if REG is not used after INSN.
We assume REG is a reload reg, and therefore does
not live past labels. It may live past calls or jumps though. */
bool
reg_unused_after (rtx reg, rtx insn)
{
enum rtx_code code;
rtx set;
/* If the reg is set by this instruction, then it is safe for our
case. Disregard the case where this is a store to memory, since
we are checking a register used in the store address. */
set = single_set (insn);
if (set && !MEM_P (SET_DEST (set))
&& reg_overlap_mentioned_p (reg, SET_DEST (set)))
return true;
while ((insn = NEXT_INSN (insn)))
{
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
rtx set;
if (!INSN_P (insn))
continue;
code = GET_CODE (insn);
#if 0
/* If this is a label that existed before reload, then the register
is dead here. However, if this is a label added by reorg, then
the register may still be live here. We can't tell the difference,
so we just ignore labels completely. */
if (code == CODE_LABEL)
return 1;
/* else */
#endif
if (code == JUMP_INSN)
return false;
/* If this is a sequence, we must handle them all at once.
We could have for instance a call that sets the target register,
and an insn in a delay slot that uses the register. In this case,
we must return 0. */
else if (code == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE)
{
int i;
int retval = 0;
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
rtx this_insn = XVECEXP (PATTERN (insn), 0, i);
rtx set = single_set (this_insn);
if (CALL_P (this_insn))
code = CALL_INSN;
else if (JUMP_P (this_insn))
{
if (INSN_ANNULLED_BRANCH_P (this_insn))
return false;
code = JUMP_INSN;
}
if (set && reg_overlap_mentioned_p (reg, SET_SRC (set)))
return false;
if (set && reg_overlap_mentioned_p (reg, SET_DEST (set)))
{
if (!MEM_P (SET_DEST (set)))
retval = true;
else
return false;
}
if (set == NULL_RTX
&& reg_overlap_mentioned_p (reg, PATTERN (this_insn)))
return false;
}
if (retval == 1)
return true;
else if (code == JUMP_INSN)
return false;
}
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
set = single_set (insn);
if (set && reg_overlap_mentioned_p (reg, SET_SRC (set)))
return false;
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 (set && reg_overlap_mentioned_p (reg, SET_DEST (set)))
return !MEM_P (SET_DEST (set));
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 (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn)))
return false;
if (code == CALL_INSN && call_really_used_regs[REGNO (reg)])
return true;
}
return true;
}
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
#include "ggc.h"
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
static GTY(()) rtx t_reg_rtx;
rtx
get_t_reg_rtx (void)
{
if (! t_reg_rtx)
t_reg_rtx = gen_rtx_REG (SImode, T_REG);
return t_reg_rtx;
}
static GTY(()) rtx fpscr_rtx;
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
rtx
get_fpscr_rtx (void)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
if (! fpscr_rtx)
{
fpscr_rtx = gen_rtx_REG (PSImode, FPSCR_REG);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
REG_USERVAR_P (fpscr_rtx) = 1;
mark_user_reg (fpscr_rtx);
}
if (! reload_completed || mdep_reorg_phase != SH_AFTER_MDEP_REORG)
mark_user_reg (fpscr_rtx);
return fpscr_rtx;
}
static GTY(()) tree fpscr_values;
static void
emit_fpu_switch (rtx scratch, int index)
{
rtx dst, src;
if (fpscr_values == NULL)
{
tree t;
t = build_index_type (integer_one_node);
t = build_array_type (integer_type_node, t);
t = build_decl (BUILTINS_LOCATION,
VAR_DECL, get_identifier ("__fpscr_values"), t);
DECL_ARTIFICIAL (t) = 1;
DECL_IGNORED_P (t) = 1;
DECL_EXTERNAL (t) = 1;
TREE_STATIC (t) = 1;
TREE_PUBLIC (t) = 1;
TREE_USED (t) = 1;
fpscr_values = t;
}
src = DECL_RTL (fpscr_values);
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
if (!can_create_pseudo_p ())
{
emit_move_insn (scratch, XEXP (src, 0));
if (index != 0)
emit_insn (gen_addsi3 (scratch, scratch, GEN_INT (index * 4)));
src = adjust_automodify_address (src, PSImode, scratch, index * 4);
}
else
src = adjust_address (src, PSImode, index * 4);
dst = get_fpscr_rtx ();
emit_move_insn (dst, src);
}
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
void
emit_sf_insn (rtx pat)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
emit_insn (pat);
}
void
emit_df_insn (rtx pat)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
emit_insn (pat);
}
void
expand_sf_unop (rtx (*fun) (rtx, rtx, rtx), rtx *operands)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
emit_sf_insn ((*fun) (operands[0], operands[1], get_fpscr_rtx ()));
}
void
expand_sf_binop (rtx (*fun) (rtx, rtx, rtx, rtx), rtx *operands)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
emit_sf_insn ((*fun) (operands[0], operands[1], operands[2],
get_fpscr_rtx ()));
}
void
expand_df_unop (rtx (*fun) (rtx, rtx, rtx), rtx *operands)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
emit_df_insn ((*fun) (operands[0], operands[1], get_fpscr_rtx ()));
}
void
expand_df_binop (rtx (*fun) (rtx, rtx, rtx, rtx), rtx *operands)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
emit_df_insn ((*fun) (operands[0], operands[1], operands[2],
get_fpscr_rtx ()));
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
static rtx get_free_reg (HARD_REG_SET);
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
/* This function returns a register to use to load the address to load
the fpscr from. Currently it always returns r1 or r7, but when we are
able to use pseudo registers after combine, or have a better mechanism
for choosing a register, it should be done here. */
/* REGS_LIVE is the liveness information for the point for which we
need this allocation. In some bare-bones exit blocks, r1 is live at the
start. We can even have all of r0..r3 being live:
__complex__ long long f (double d) { if (d == 0) return 2; else return 3; }
INSN before which new insns are placed with will clobber the register
we return. If a basic block consists only of setting the return value
register to a pseudo and using that register, the return value is not
live before or after this block, yet we we'll insert our insns right in
the middle. */
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
static rtx
get_free_reg (HARD_REG_SET regs_live)
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
{
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
if (! TEST_HARD_REG_BIT (regs_live, 1))
return gen_rtx_REG (Pmode, 1);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. * doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation, based on the above, for new target hook. * hooks.c (hook_bool_mode_true): New generic hook. * hooks.h (hook_bool_mode_true): Add prototype. * target.h (struct gcc_target): Add small_register_classes_for_mode_p target hook. * target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default target hook, set to hook_bool_mode_false. * regs.h: Remove default definition of SMALL_REGISTER_CLASSES. * reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES with targetm.small_register_classes_for_mode_p. (find_reusable_reload): Likewise. (combine_reloads): Likewise. * reload1.c (reload_as_needed): Likewise. * cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise. * ifcvt.c (noce_process_if_block, check_cond_move_block, dead_or_predicable): Likewise. * regmove.c (optimize_reg_copy_1): Likewise. * calls.c (prepare_call_address): Likewise. (precompute_register_parameters): Likewise. * config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/sh/sh.c (sh_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small except for SH64. (sh_override_options): Use the new hook. * config/sh/sh-protos.h (sh_small_register_classes_for_mode_p): Add prototype. * config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/arm/arm.c (arm_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for THUMB1. * config/arm/arm-protos.h (arm_small_register_classes_for_mode_p): Add prototype. * config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/mips/mips.c (mips_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for MIPS16. * config/mips/mips-protos.h (mips_small_register_classes_for_mode_p): Add prototype. * config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/m32c/m32c.h: Likewise. * config/pdp11/pdp11.h: Likewise. * config/avr/avr.h: Likewise. * config/xtensa/xtensa.h: Likewise. * config/m68hc11/m68hc11.h: Likewise. * config/mn10300/mn10300.h: Likewise. * config/mcore/mcore.h: Likewise. * config/h8300/h8300.h: Likewise. * config/bfin/bfin.h: Likewise. * config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition. * config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition. From-SVN: r158997
2010-05-03 19:47:47 +02:00
/* Hard reg 1 is live; since this is a small register classes target,
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
there shouldn't be anything but a jump before the function end. */
gcc_assert (!TEST_HARD_REG_BIT (regs_live, 7));
return gen_rtx_REG (Pmode, 7);
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
}
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
/* This function will set the fpscr from memory.
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
MODE is the mode we are setting it to. */
void
fpscr_set_from_mem (int mode, HARD_REG_SET regs_live)
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
{
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 attr_fp_mode fp_mode = (enum attr_fp_mode) mode;
enum attr_fp_mode norm_mode = ACTUAL_NORMAL_MODE (FP_MODE);
rtx addr_reg;
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01: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
addr_reg = !can_create_pseudo_p () ? get_free_reg (regs_live) : NULL_RTX;
emit_fpu_switch (addr_reg, fp_mode == norm_mode);
Add SH4 support: * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. (fp_reg_names, assembler_dialect): New variables. (print_operand_address): Handle SUBREGs. (print_operand): Added 'o' case. Don't use adj_offsettable_operand on PRE_DEC / POST_INC. Name of FP registers depends on mode. (expand_block_move): Emit different code for SH4 hardware. (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. (from_compare): Likewise. (add_constant): New argument last_value. Changed all callers. (find_barrier): Don't try HImode load for FPUL_REG. (machine_dependent_reorg): Likewise. (sfunc_uses_reg): A CLOBBER cannot be the address register use. (gen_far_branch): Emit a barrier after the new jump. (barrier_align): Don't trust instruction lengths before fixing up pcloads. (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. Use auto-inc addressing for fp registers if doubles need to be loaded in two steps. Set sh_flag_remove_dead_before_cse. (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. (sh_expand_epilogue): Likewise. (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. (arith_reg_operand): FPUL_REG is OK for SH4. (fp_arith_reg_operand, fp_extended_operand) New functions. (tertiary_reload_operand, fpscr_operand): Likewise. (commutative_float_operator, noncommutative_float_operator): Likewise. (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. (CONDITIONAL_REGISTER_USAGE): Likewise. (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer to -1 and sh_flag_remove_dead_before_cse to 1. (ASSEMBLER_DIALECT): Define to assembler_dialect. (assembler_dialect, fp_reg_names): Declare. (OVERRIDE_OPTIONS): Add code for TARGET_SH4. Hide names of registers that are not accessible. (CACHE_LOG): Take TARGET_CACHE32 into account. (LOOP_ALIGN): Take TARGET_HARWARD into account. (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. (FIRST_PSEUDO_REGISTER: Now 49. (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. (HARD_REGNO_MODE_OK): Update. (enum reg_class): Add DF_REGS and FPSCR_REGS. (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. (NPARM_REGS): Eight floating point parameter registers on SH4. (BASE_RETURN_VALUE_REG): SH4 also passes double values in floating point registers. (GET_SH_ARG_CLASS) Likewise. Complex float types are also returned in float registers. (BASE_ARG_REG): Complex float types are also passes in float registers. (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. (LIBCALL_VALUE): Remove trailing semicolon. (ROUND_REG): Round when double precision value is passed in floating point register(s). (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are passed on the stack. (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. (MODE_DISP_OK_8): Not for SH4 DFmode. (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. Allow indexed addressing for PSImode after reload. (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. (DOUBLE_TYPE_SIZE): 64 for SH4. (RTX_COSTS): Add PLUS case. Increae cost of ASHIFT, ASHIFTRT, LSHIFTRT case. (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, MAC_REGS, PR_REGS, DF_REGS. (REGISTER_NAMES): Use fp_reg_names. (enum processor_type): Add PROCESSOR_SH4. (sh_flag_remove_dead_before_cse): Declare. (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. (PREDICATE_CODES): Add binary_float_operator, commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, fpscr_operand, noncommutative_float_operator. (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. * sh.md (attribute cpu): Add value sh4. (attrbutes fmovd, issues): Define. (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. (function units memory, int, mpy, fp): Make dependent on issue rate. (function units issue, single_issue, load_si, load): Define. (function units load_store, fdiv, gp_fpul): Define. (attribute hit_stack): Provide proper default. (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. (udivsi3, divsi3): Emit special patterns for SH4 hardware, (mulsi3_call): Now uses match_operand for function address. (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / REG_RETVAL notes. (push, pop, push_e, pop_e): Now define_expands. (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. (movsi_ie): Added y/i alternative. (ic_invalidate_line_i, movdf_i4): New insns. (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. (movdf): Add special code for SH4. (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. (call_valuei, calli, call_value): Likewise. (movsf): Emit no-op move. (mov_nop, movsi_y): New insns. (blt, sge): generalize to handle DFmode. (return predicate): Call emit_fpscr_use and remove_dead_before_cse. (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. (fpu_switch0, fpu_switch1, movpsi): New expanders. (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. (toggle_sz): New insn. (addsf3, subsf3, mulsf3, divsf3): Now define_expands. (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. (macsf3): Make use of fpscr visible. Disable for SH4. (floatsisf2): Make use of fpscr visible. (floatsisf2_i4): New insn. (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. (ieee_ccmpeqsf_t): Likewise. (fix_truncsfsi2): Emit different code for SH4. (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. (negsf2, sqrtsf2, abssf2): Now expanders. (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. (fix_truncdfsi2_i4_2+1): New splitters. (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. (extendsfdf2, truncdfsf2): New expanders. (truncdfsf2_i4): New insn. * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. * float-sh.h: When testing for __SH3E__, also test for __SH4_SINGLE_ONLY__ . * va-sh.h (__va_freg): Define to float. (__va_greg, __fa_freg, __gnuc_va_list, va_start): Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. (__PASS_AS_FLOAT): Use different definition for __SH4__ and __SH4_SINGLE__. (TARGET_SH4_P): Define. (va_arg): Use it. * sh.md (movdf_k, movsf_i): Tweak the condition so that init_expr_once is satisfied about the existence of load / store insns. * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): change m constraint in source operand to mr / mf . * va-sh.h (__va_arg_sh1): Use __asm instead of asm. * (__VA_REEF): Define. (__va_arg_sh1): Use it. * va-sh.h (va_start, va_arg, va_copy): Add parenteses. From-SVN: r23777
1998-11-23 09:50:42 +01:00
}
/* Is the given character a logical line separator for the assembler? */
#ifndef IS_ASM_LOGICAL_LINE_SEPARATOR
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C, STR) ((C) == ';')
#endif
static bool
sequence_insn_p (rtx insn)
{
rtx prev, next;
prev = PREV_INSN (insn);
if (prev == NULL)
return false;
next = NEXT_INSN (prev);
if (next == NULL)
return false;
return INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE;
}
int
sh_insn_length_adjustment (rtx insn)
{
/* Instructions with unfilled delay slots take up an extra two bytes for
the nop in the delay slot. */
if (((NONJUMP_INSN_P (insn)
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER)
|| CALL_P (insn)
2010-01-26 08:20:27 +01:00
|| (JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn)))
&& ! sequence_insn_p (insn)
&& get_attr_needs_delay_slot (insn) == NEEDS_DELAY_SLOT_YES)
return 2;
/* SH2e has a bug that prevents the use of annulled branches, so if
the delay slot is not filled, we'll have to put a NOP in it. */
if (sh_cpu_attr == CPU_SH2E
2010-01-26 08:20:27 +01:00
&& JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn)
&& get_attr_type (insn) == TYPE_CBRANCH
&& ! sequence_insn_p (insn))
return 2;
/* sh-dsp parallel processing insn take four bytes instead of two. */
if (NONJUMP_INSN_P (insn))
{
int sum = 0;
rtx body = PATTERN (insn);
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
const char *templ;
char c;
bool maybe_label = true;
if (GET_CODE (body) == ASM_INPUT)
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
templ = XSTR (body, 0);
else if (asm_noperands (body) >= 0)
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
templ
= decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
else
return 0;
do
{
int ppi_adjust = 0;
do
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
c = *templ++;
while (c == ' ' || c == '\t');
/* all sh-dsp parallel-processing insns start with p.
The only non-ppi sh insn starting with p is pref.
The only ppi starting with pr is prnd. */
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
if ((c == 'p' || c == 'P') && strncasecmp ("re", templ, 2))
ppi_adjust = 2;
/* The repeat pseudo-insn expands two three insns, a total of
six bytes in size. */
else if ((c == 'r' || c == 'R')
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
&& ! strncasecmp ("epeat", templ, 5))
ppi_adjust = 4;
while (c && c != '\n'
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
&& ! IS_ASM_LOGICAL_LINE_SEPARATOR (c, templ))
{
/* If this is a label, it is obviously not a ppi insn. */
if (c == ':' && maybe_label)
{
ppi_adjust = 0;
break;
}
else if (c == '\'' || c == '"')
maybe_label = false;
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
c = *templ++;
}
sum += ppi_adjust;
maybe_label = c != ':';
}
while (c);
return sum;
}
return 0;
}
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
/* Return TRUE for a valid displacement for the REG+disp addressing
with MODE. */
bool
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
sh_legitimate_index_p (enum machine_mode mode, rtx op, bool consider_sh2a,
bool allow_zero)
{
if (! CONST_INT_P (op))
return false;
if (TARGET_SHMEDIA)
{
int size;
/* Check if this is the address of an unaligned load / store. */
if (mode == VOIDmode)
return satisfies_constraint_I06 (op);
size = GET_MODE_SIZE (mode);
return (!(INTVAL (op) & (size - 1))
&& INTVAL (op) >= -512 * size
&& INTVAL (op) < 512 * size);
}
else
{
const HOST_WIDE_INT offset = INTVAL (op);
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
const int max_disp = max_mov_insn_displacement (mode, consider_sh2a);
const int align_mask = mov_insn_alignment_mask (mode, consider_sh2a);
/* If the mode does not support any displacement always return false.
Even though an index of '0' is actually always valid, it will cause
troubles when e.g. a DFmode move is split into two SFmode moves,
where one SFmode move will have index '0' and the other move will
have index '4'. */
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
if (!allow_zero && max_disp < 1)
return false;
return offset >= 0 && offset <= max_disp && (offset & align_mask) == 0;
}
}
/* Recognize an RTL expression that is a valid memory address for
an instruction.
The MODE argument is the machine mode for the MEM expression
that wants to use this address.
Allow REG
REG+disp
REG+r0
REG++
--REG
GBR
GBR+disp */
static bool
sh_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
{
if (REG_P (x) && REGNO (x) == GBR_REG)
return true;
if (MAYBE_BASE_REGISTER_RTX_P (x, strict))
return true;
else if ((GET_CODE (x) == POST_INC || GET_CODE (x) == PRE_DEC)
&& ! TARGET_SHMEDIA
&& MAYBE_BASE_REGISTER_RTX_P (XEXP (x, 0), strict))
return true;
else if (GET_CODE (x) == PLUS
&& (mode != PSImode || reload_completed))
{
rtx xop0 = XEXP (x, 0);
rtx xop1 = XEXP (x, 1);
if (REG_P (xop0) && REGNO (xop0) == GBR_REG)
return gbr_displacement (xop1, mode);
if (GET_MODE_SIZE (mode) <= 8
&& MAYBE_BASE_REGISTER_RTX_P (xop0, strict)
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
&& sh_legitimate_index_p (mode, xop1, TARGET_SH2A, false))
return true;
if ((ALLOW_INDEXED_ADDRESS || GET_MODE (x) == DImode
|| ((xop0 == stack_pointer_rtx
|| xop0 == hard_frame_pointer_rtx)
&& REG_P (xop1) && REGNO (xop1) == R0_REG)
|| ((xop1 == stack_pointer_rtx
|| xop1 == hard_frame_pointer_rtx)
&& REG_P (xop0) && REGNO (xop0) == R0_REG))
&& ((!TARGET_SHMEDIA && GET_MODE_SIZE (mode) <= 4)
|| (TARGET_SHMEDIA && GET_MODE_SIZE (mode) <= 8)
|| ((TARGET_SH4 || TARGET_SH2A_DOUBLE)
&& TARGET_FMOVD && mode == DFmode)))
{
if (MAYBE_BASE_REGISTER_RTX_P (xop1, strict)
&& MAYBE_INDEX_REGISTER_RTX_P (xop0, strict))
return true;
if (MAYBE_INDEX_REGISTER_RTX_P (xop1, strict)
&& MAYBE_BASE_REGISTER_RTX_P (xop0, strict))
return true;
}
}
return false;
}
/* Return TRUE if X references a SYMBOL_REF or LABEL_REF whose symbol
isn't protected by a PIC unspec. */
bool
nonpic_symbol_mentioned_p (rtx x)
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
{
const char *fmt;
int i;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF
|| GET_CODE (x) == PC)
return true;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* We don't want to look into the possible MEM location of a
CONST_DOUBLE, since we're not going to use it, in general. */
if (GET_CODE (x) == CONST_DOUBLE)
return false;
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
if (GET_CODE (x) == UNSPEC
&& (XINT (x, 1) == UNSPEC_PIC
|| XINT (x, 1) == UNSPEC_GOT
|| XINT (x, 1) == UNSPEC_GOTOFF
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
|| XINT (x, 1) == UNSPEC_GOTPLT
|| XINT (x, 1) == UNSPEC_GOTTPOFF
|| XINT (x, 1) == UNSPEC_DTPOFF
|| XINT (x, 1) == UNSPEC_TPOFF
sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. gcc/ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete. (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P. (PIC_OFFSET_P): Rename to... (PCREL_SYMOFF_P): ...this. (PIC_DIRECT_ADDR_P): Delete. (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of PIC_OFFSET_P. (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16, UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (print_operand): Remove CONST handling. (unspec_caller_rtx_p): Rewrite to use split_const and check the operands of UNSPEC bases. (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC) with (unspec [A B] UNSPEC_SYMOFF). (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec. (UNSPEC_EXTRACT_U16): Likewise. (UNSPEC_SYMOFF): Likewise. (UNSPEC_PCREL_SYMOFF): Likewise. (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions of constants. (movsi_const_16bit): Likewise. (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise. (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC) with (unspec [A B] UNSPEC_PCREL_SYMOFF). (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B) with (unspec [A B] UNSPEC_SYMOFF). (symPLT_label2reg): Replace (minus A (minus B pc)) with (unspec [A B] PCREL_UNSPEC_SYMOFF). * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16. (Csu): Likewise UNSPEC_EXTRACT_U16. (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P. From-SVN: r141046
2008-10-10 20:28:25 +02:00
|| XINT (x, 1) == UNSPEC_PLT
|| XINT (x, 1) == UNSPEC_SYMOFF
|| XINT (x, 1) == UNSPEC_PCREL_SYMOFF))
return false;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
fmt = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
{
if (fmt[i] == 'E')
{
int j;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
if (nonpic_symbol_mentioned_p (XVECEXP (x, i, j)))
return true;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
}
else if (fmt[i] == 'e' && nonpic_symbol_mentioned_p (XEXP (x, i)))
return true;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
}
return false;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
}
/* Convert a non-PIC address in `orig' to a PIC address using @GOT or
@GOTOFF in `reg'. */
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
rtx
legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
rtx reg)
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
{
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
if (tls_symbolic_operand (orig, Pmode) != TLS_MODEL_NONE)
return orig;
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
if (GET_CODE (orig) == LABEL_REF
|| (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig)))
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
{
if (reg == NULL_RTX)
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
reg = gen_reg_rtx (Pmode);
emit_insn (gen_symGOTOFF2reg (reg, orig));
return reg;
}
else if (GET_CODE (orig) == SYMBOL_REF)
{
if (reg == NULL_RTX)
t-elf, [...]: New files. * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, config/sh/crtn.asm: New files. * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. (crt1.o, crti.o, crtn.o): New targets. * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added sh/t-elf. * configure: Rebuilt. * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undefine for config/elfos.h to redefine. (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, legitimize_pic_address, output_pic_addr_const): Declare. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. (TARGET_SWITCHES): New switch -mprefergot. (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. (PIC_OFFSET_TABLE_REGNUM): Define. (GOT_SYMBOL_TABLE): Likewise. (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. (ENCODE_SECTION_INFO): Define. (FINALIZE_PIC): New macros. (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. (prepare_move_operands): Call emit_pic_move or emit_pic_const_move if appropriate. (output_far_jump): For PIC, use braf and output long offset. (machine_dependent_reorg): (sh_expand_prologue): Save and initialize the PIC register. (sh_expand_epilogue): Restore it. (initial_elimination_offset): Account for it. (nonpic_symbol_mentioned_p): New function. (legitimize_pic_address): Likewise. (output_pic_addr_const): Likewise. * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. (call, call_value): Use them. (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, symPLT_label2reg): New expands. * invoke.texi (SH Options): Document -mprefergot. From-SVN: r36111
2000-09-02 05:28:47 +02:00
reg = gen_reg_rtx (Pmode);
emit_insn (gen_symGOT2reg (reg, orig));
return reg;
}
return orig;
}
/* Given a (logical) mode size and an offset in bytes, try to find a the
appropriate displacement value for a mov insn. On SH the displacements
are limited to max. 60 bytes for SImode, max. 30 bytes in HImode and max.
15 bytes in QImode. To compensate this we create a new base address by
adding an adjustment value to it.
If the originally requested offset is greater than 127 we prefer using
values 124..127 over 128..131 to increase opportunities to use the
add #imm, Rn insn.
In some cases it is possible that a requested offset might seem unaligned
or inappropriate for the mode size, like offset = 2 and mode size = 4.
This is compensated by adjusting the base address so that the effective
address of the displacement move insn will be aligned.
This is not the best possible way of rebasing the base address, as it
does not look at other present displacement addressings around it.
In some cases this can create more base address adjustments than would
actually be necessary. */
struct disp_adjust
{
rtx offset_adjust;
rtx mov_disp;
};
static struct disp_adjust
sh_find_mov_disp_adjust (enum machine_mode mode, HOST_WIDE_INT offset)
{
struct disp_adjust res = { NULL_RTX, NULL_RTX };
/* Do not try to use SH2A's large displacements here, because this would
effectively disable the small displacement insns. */
const int mode_sz = GET_MODE_SIZE (mode);
const int mov_insn_sz = mov_insn_size (mode, false);
const int max_disp = max_mov_insn_displacement (mode, false);
const int max_disp_next = max_disp + mov_insn_sz;
HOST_WIDE_INT align_modifier = offset > 127 ? mov_insn_sz : 0;
HOST_WIDE_INT offset_adjust;
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
/* In some cases this actually does happen and we must check for it. */
if (mode_sz < 1 || mode_sz > 8 || max_disp < 1)
return res;
/* Keeps the previous behavior for QImode displacement addressing.
This just decides how the offset is re-based. Removing this special
case will result in slightly bigger code on average, but it's not that
bad actually. */
if (mov_insn_sz == 1)
align_modifier = 0;
offset_adjust = ((offset + align_modifier) & ~max_disp) - align_modifier;
if (mode_sz + offset - offset_adjust <= max_disp_next)
{
res.offset_adjust = GEN_INT (offset_adjust);
res.mov_disp = GEN_INT (offset - offset_adjust);
}
return res;
}
/* Try to modify an illegitimate address and make it legitimate.
If we find one, return the new, valid address.
Otherwise, return the original address. */
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
static rtx
sh_legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
{
if (flag_pic)
x = legitimize_pic_address (oldx, mode, NULL_RTX);
if (TARGET_SHMEDIA)
return x;
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
if (((TARGET_SH4 || TARGET_SH2A_DOUBLE) && mode == DFmode)
|| (TARGET_SH2E && mode == SFmode))
return x;
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
if (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1))
&& BASE_REGISTER_RTX_P (XEXP (x, 0)))
{
struct disp_adjust adj = sh_find_mov_disp_adjust (mode,
INTVAL (XEXP (x, 1)));
if (adj.offset_adjust != NULL_RTX && adj.mov_disp != NULL_RTX)
{
rtx sum = expand_binop (Pmode, add_optab, XEXP (x, 0),
adj.offset_adjust, NULL_RTX, 0,
OPTAB_LIB_WIDEN);
return gen_rtx_PLUS (Pmode, sum, adj.mov_disp);
}
}
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
return x;
}
/* Attempt to replace *p, which is an address that needs reloading, with
a valid memory address for an operand of mode MODE.
Like for sh_legitimize_address, for the SH we try to get a normal form
of the address. That will allow inheritance of the address reloads. */
bool
sh_legitimize_reload_address (rtx *p, enum machine_mode mode, int opnum,
int itype)
{
enum reload_type type = (enum reload_type) itype;
const int mode_sz = GET_MODE_SIZE (mode);
if (TARGET_SHMEDIA)
return false;
if (GET_CODE (*p) == PLUS && CONST_INT_P (XEXP (*p, 1))
&& MAYBE_BASE_REGISTER_RTX_P (XEXP (*p, 0), true)
&& ! (mode == PSImode && type == RELOAD_FOR_INPUT_ADDRESS)
&& (ALLOW_INDEXED_ADDRESS
|| XEXP (*p, 0) == stack_pointer_rtx
|| XEXP (*p, 0) == hard_frame_pointer_rtx))
{
const HOST_WIDE_INT offset = INTVAL (XEXP (*p, 1));
struct disp_adjust adj = sh_find_mov_disp_adjust (mode, offset);
if (TARGET_SH2A && mode == DFmode && (offset & 0x7))
{
push_reload (*p, NULL_RTX, p, NULL,
BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type);
return true;
}
if (TARGET_SH2E && mode == SFmode)
{
*p = copy_rtx (*p);
push_reload (*p, NULL_RTX, p, NULL,
BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type);
return true;
}
/* FIXME: Do not allow to legitimize QImode and HImode displacement
moves because then reload has a problem figuring the constraint
that the move insn target/source reg must be R0.
Or maybe some handling is wrong in sh_secondary_reload for this
to work properly? */
if ((mode_sz == 4 || mode_sz == 8)
&& ! (TARGET_SH4 && mode == DFmode)
&& adj.offset_adjust != NULL_RTX && adj.mov_disp != NULL_RTX)
{
rtx sum = gen_rtx_PLUS (Pmode, XEXP (*p, 0), adj.offset_adjust);
*p = gen_rtx_PLUS (Pmode, sum, adj.mov_disp);
push_reload (sum, NULL_RTX, &XEXP (*p, 0), NULL,
BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type);
return true;
}
}
/* We must re-recognize what we created before. */
if (GET_CODE (*p) == PLUS
&& (mode_sz == 4 || mode_sz == 8)
&& GET_CODE (XEXP (*p, 0)) == PLUS
&& CONST_INT_P (XEXP (XEXP (*p, 0), 1))
&& MAYBE_BASE_REGISTER_RTX_P (XEXP (XEXP (*p, 0), 0), true)
&& CONST_INT_P (XEXP (*p, 1))
&& ! (TARGET_SH2E && mode == SFmode))
{
/* Because this address is so complex, we know it must have
been created by LEGITIMIZE_RELOAD_ADDRESS before; thus,
it is already unshared, and needs no further unsharing. */
push_reload (XEXP (*p, 0), NULL_RTX, &XEXP (*p, 0), NULL,
BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type);
return true;
}
return false;
}
/* In the name of slightly smaller debug output, and to cater to
general assembler lossage, recognize various UNSPEC sequences
and turn them back into a direct symbol reference. */
static rtx
sh_delegitimize_address (rtx orig_x)
{
rtx x, y;
orig_x = delegitimize_mem_from_attrs (orig_x);
x = orig_x;
if (MEM_P (x))
x = XEXP (x, 0);
if (GET_CODE (x) == CONST)
{
y = XEXP (x, 0);
if (GET_CODE (y) == UNSPEC)
{
if (XINT (y, 1) == UNSPEC_GOT
|| XINT (y, 1) == UNSPEC_GOTOFF
|| XINT (y, 1) == UNSPEC_SYMOFF)
return XVECEXP (y, 0, 0);
else if (XINT (y, 1) == UNSPEC_PCREL_SYMOFF)
{
if (GET_CODE (XVECEXP (y, 0, 0)) == CONST)
{
rtx symplt = XEXP (XVECEXP (y, 0, 0), 0);
if (GET_CODE (symplt) == UNSPEC
&& XINT (symplt, 1) == UNSPEC_PLT)
return XVECEXP (symplt, 0, 0);
}
}
else if (TARGET_SHMEDIA
&& (XINT (y, 1) == UNSPEC_EXTRACT_S16
|| XINT (y, 1) == UNSPEC_EXTRACT_U16))
{
rtx offset = XVECEXP (y, 0, 1);
x = gen_rtx_PLUS (Pmode, XVECEXP (y, 0, 0), offset);
if (MEM_P (orig_x))
x = replace_equiv_address_nv (orig_x, x);
return x;
}
}
}
return orig_x;
}
/* Mark the use of a constant in the literal table. If the constant
has multiple labels, make it unique. */
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
static rtx
mark_constant_pool_use (rtx x)
{
rtx insn, lab, pattern;
if (x == NULL_RTX)
return x;
switch (GET_CODE (x))
{
case LABEL_REF:
x = XEXP (x, 0);
case CODE_LABEL:
break;
default:
return x;
}
/* Get the first label in the list of labels for the same constant
and delete another labels in the list. */
lab = x;
for (insn = PREV_INSN (x); insn; insn = PREV_INSN (insn))
{
if (!LABEL_P (insn)
|| LABEL_REFS (insn) != NEXT_INSN (insn))
break;
lab = insn;
}
for (insn = LABEL_REFS (lab); insn; insn = LABEL_REFS (insn))
INSN_DELETED_P (insn) = 1;
/* Mark constants in a window. */
for (insn = NEXT_INSN (x); insn; insn = NEXT_INSN (insn))
{
if (!NONJUMP_INSN_P (insn))
continue;
pattern = PATTERN (insn);
if (GET_CODE (pattern) != UNSPEC_VOLATILE)
continue;
switch (XINT (pattern, 1))
{
case UNSPECV_CONST2:
case UNSPECV_CONST4:
case UNSPECV_CONST8:
XVECEXP (pattern, 0, 1) = const1_rtx;
break;
case UNSPECV_WINDOW_END:
if (XVECEXP (pattern, 0, 0) == x)
return lab;
break;
case UNSPECV_CONST_END:
return lab;
default:
break;
}
}
return lab;
}
/* Return true if it's possible to redirect BRANCH1 to the destination
of an unconditional jump BRANCH2. We only want to do this if the
resulting branch will have a short displacement. */
bool
sh_can_redirect_branch (rtx branch1, rtx branch2)
{
if (flag_expensive_optimizations && simplejump_p (branch2))
{
rtx dest = XEXP (SET_SRC (single_set (branch2)), 0);
rtx insn;
int distance;
for (distance = 0, insn = NEXT_INSN (branch1);
insn && distance < 256;
insn = PREV_INSN (insn))
{
if (insn == dest)
return true;
else
distance += get_attr_length (insn);
}
for (distance = 0, insn = NEXT_INSN (branch1);
insn && distance < 256;
insn = NEXT_INSN (insn))
{
if (insn == dest)
return true;
else
distance += get_attr_length (insn);
}
}
return false;
}
/* Return nonzero if register old_reg can be renamed to register new_reg. */
bool
sh_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
unsigned int new_reg)
{
/* Interrupt functions can only use registers that have already been
saved by the prologue, even if they would normally be
call-clobbered. */
if (sh_cfun_interrupt_handler_p () && !df_regs_ever_live_p (new_reg))
return false;
return true;
}
/* Function to update the integer COST
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
based on the relationship between INSN that is dependent on
DEP_INSN through the dependence LINK. The default is to make no
adjustment to COST. This can be used for example to specify to
the scheduler that an output- or anti-dependence does not incur
the same cost as a data-dependence. The return value should be
the new value for COST. */
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
sh_adjust_cost (rtx insn, rtx link ATTRIBUTE_UNUSED, rtx dep_insn, int cost)
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
{
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
rtx reg, use_pat;
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
sh.c (sh_adjust_cost): Special handling of SHMEDIA code. Tue Jul 9 22:37:44 2002 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * sh.c (sh_adjust_cost): Special handling of SHMEDIA code. * sh.md (attribute issues): Replace with: (attribute pipe_model). All users changed. (attribute type): Change pt / ptabs to pt_media / ptabs_media. All users changed. (function units sh5issue, sh5fds): New. (attribute is_mac_media): New. (adddi3_media, subdi3_media, divsi3_i1_media, anddi3): Add type. (andcdi3, iordi3, xordi3, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media, negdi_media, extendsidi2, movqi_media): Likewise. (movhi_media, shori_media, movv2sf_i, jump_media): Likewise. (call_media, call_value_media, sibcall_media): Likewise. (casesi_jump_media, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, addsf3_media, subsf3_media, mulsf3_media): Likewise. (mac_media, divsf3_media, floatdisf2, floatsisf2_media): Likewise. (fix_truncsfdi2, fix_truncsfsi2_media, cmpeqsf_media): Likewise. (cmpgtsf_media, cmpgesf_media, cmpunsf_media, negsf2_media): Likewise. (sqrtsf2_media, abssf2_media, adddf3_media, subdf3_media): Likewise. (muldf3_media, divdf3_media, floatdidf2, floatsidf2_media): Likewise. (fix_truncdfdi2, fix_truncdfsi2_media, cmpeqdf_media): Likewise. (cmpgtdf_media, cmpgedf_media,cmpundf_media, negdf2_media): Likewise. (sqrtdf2_media, absdf2_media, extendsfdf2_media): Likewise. (truncdfsf2_media): Likewise. (movsi_media, movsi_media_nofpu, movdi_media): Use new types. (movdi_media_nofpui, movdf_media, movdf_media_nofpu): Likewise. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r55346
2002-07-10 00:04:34 +02:00
if (TARGET_SHMEDIA)
{
/* On SHmedia, if the dependence is an anti-dependence or
output-dependence, there is no cost. */
sh.c (sh_adjust_cost): Special handling of SHMEDIA code. Tue Jul 9 22:37:44 2002 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * sh.c (sh_adjust_cost): Special handling of SHMEDIA code. * sh.md (attribute issues): Replace with: (attribute pipe_model). All users changed. (attribute type): Change pt / ptabs to pt_media / ptabs_media. All users changed. (function units sh5issue, sh5fds): New. (attribute is_mac_media): New. (adddi3_media, subdi3_media, divsi3_i1_media, anddi3): Add type. (andcdi3, iordi3, xordi3, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media, negdi_media, extendsidi2, movqi_media): Likewise. (movhi_media, shori_media, movv2sf_i, jump_media): Likewise. (call_media, call_value_media, sibcall_media): Likewise. (casesi_jump_media, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, addsf3_media, subsf3_media, mulsf3_media): Likewise. (mac_media, divsf3_media, floatdisf2, floatsisf2_media): Likewise. (fix_truncsfdi2, fix_truncsfsi2_media, cmpeqsf_media): Likewise. (cmpgtsf_media, cmpgesf_media, cmpunsf_media, negsf2_media): Likewise. (sqrtsf2_media, abssf2_media, adddf3_media, subdf3_media): Likewise. (muldf3_media, divdf3_media, floatdidf2, floatsidf2_media): Likewise. (fix_truncdfdi2, fix_truncdfsi2_media, cmpeqdf_media): Likewise. (cmpgtdf_media, cmpgedf_media,cmpundf_media, negdf2_media): Likewise. (sqrtdf2_media, absdf2_media, extendsfdf2_media): Likewise. (truncdfsf2_media): Likewise. (movsi_media, movsi_media_nofpu, movdi_media): Use new types. (movdi_media_nofpui, movdf_media, movdf_media_nofpu): Likewise. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r55346
2002-07-10 00:04:34 +02:00
if (REG_NOTE_KIND (link) != 0)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{
/* However, dependencies between target register loads and
uses of the register in a subsequent block that are separated
by a conditional branch are not modelled - we have to do with
the anti-dependency between the target register load and the
conditional branch that ends the current block. */
if (REG_NOTE_KIND (link) == REG_DEP_ANTI
&& GET_CODE (PATTERN (dep_insn)) == SET
&& (get_attr_type (dep_insn) == TYPE_PT_MEDIA
|| get_attr_type (dep_insn) == TYPE_PTABS_MEDIA)
&& get_attr_type (insn) == TYPE_CBRANCH_MEDIA)
{
int orig_cost = cost;
rtx note = find_reg_note (insn, REG_BR_PROB, 0);
rtx target = ((! note
|| INTVAL (XEXP (note, 0)) * 2 < REG_BR_PROB_BASE)
? insn : JUMP_LABEL (insn));
/* On the likely path, the branch costs 1, on the unlikely path,
it costs 3. */
cost--;
do
target = next_active_insn (target);
while (target && ! flow_dependent_p (target, dep_insn)
&& --cost > 0);
/* If two branches are executed in immediate succession, with the
first branch properly predicted, this causes a stall at the
second branch, hence we won't need the target for the
second branch for two cycles after the launch of the first
branch. */
if (cost > orig_cost - 2)
cost = orig_cost - 2;
}
else
cost = 0;
}
sh.c (sh_adjust_cost): Special handling of SHMEDIA code. Tue Jul 9 22:37:44 2002 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * sh.c (sh_adjust_cost): Special handling of SHMEDIA code. * sh.md (attribute issues): Replace with: (attribute pipe_model). All users changed. (attribute type): Change pt / ptabs to pt_media / ptabs_media. All users changed. (function units sh5issue, sh5fds): New. (attribute is_mac_media): New. (adddi3_media, subdi3_media, divsi3_i1_media, anddi3): Add type. (andcdi3, iordi3, xordi3, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media, negdi_media, extendsidi2, movqi_media): Likewise. (movhi_media, shori_media, movv2sf_i, jump_media): Likewise. (call_media, call_value_media, sibcall_media): Likewise. (casesi_jump_media, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, addsf3_media, subsf3_media, mulsf3_media): Likewise. (mac_media, divsf3_media, floatdisf2, floatsisf2_media): Likewise. (fix_truncsfdi2, fix_truncsfsi2_media, cmpeqsf_media): Likewise. (cmpgtsf_media, cmpgesf_media, cmpunsf_media, negsf2_media): Likewise. (sqrtsf2_media, abssf2_media, adddf3_media, subdf3_media): Likewise. (muldf3_media, divdf3_media, floatdidf2, floatsidf2_media): Likewise. (fix_truncdfdi2, fix_truncdfsi2_media, cmpeqdf_media): Likewise. (cmpgtdf_media, cmpgedf_media,cmpundf_media, negdf2_media): Likewise. (sqrtdf2_media, absdf2_media, extendsfdf2_media): Likewise. (truncdfsf2_media): Likewise. (movsi_media, movsi_media_nofpu, movdi_media): Use new types. (movdi_media_nofpui, movdf_media, movdf_media_nofpu): Likewise. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r55346
2002-07-10 00:04:34 +02:00
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
else if (get_attr_is_mac_media (insn)
&& get_attr_is_mac_media (dep_insn))
cost = 1;
else if (! reload_completed
&& GET_CODE (PATTERN (insn)) == SET
&& GET_CODE (SET_SRC (PATTERN (insn))) == FLOAT
&& GET_CODE (PATTERN (dep_insn)) == SET
&& fp_arith_reg_operand (SET_SRC (PATTERN (dep_insn)), VOIDmode)
&& cost < 4)
cost = 4;
/* Schedule the ptabs for a casesi_jump_media in preference to stuff
that is needed at the target. */
else if (get_attr_type (insn) == TYPE_JUMP_MEDIA
&& ! flow_dependent_p (insn, dep_insn))
cost--;
sh.c (sh_adjust_cost): Special handling of SHMEDIA code. Tue Jul 9 22:37:44 2002 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * sh.c (sh_adjust_cost): Special handling of SHMEDIA code. * sh.md (attribute issues): Replace with: (attribute pipe_model). All users changed. (attribute type): Change pt / ptabs to pt_media / ptabs_media. All users changed. (function units sh5issue, sh5fds): New. (attribute is_mac_media): New. (adddi3_media, subdi3_media, divsi3_i1_media, anddi3): Add type. (andcdi3, iordi3, xordi3, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media, negdi_media, extendsidi2, movqi_media): Likewise. (movhi_media, shori_media, movv2sf_i, jump_media): Likewise. (call_media, call_value_media, sibcall_media): Likewise. (casesi_jump_media, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, addsf3_media, subsf3_media, mulsf3_media): Likewise. (mac_media, divsf3_media, floatdisf2, floatsisf2_media): Likewise. (fix_truncsfdi2, fix_truncsfsi2_media, cmpeqsf_media): Likewise. (cmpgtsf_media, cmpgesf_media, cmpunsf_media, negsf2_media): Likewise. (sqrtsf2_media, abssf2_media, adddf3_media, subdf3_media): Likewise. (muldf3_media, divdf3_media, floatdidf2, floatsidf2_media): Likewise. (fix_truncdfdi2, fix_truncdfsi2_media, cmpeqdf_media): Likewise. (cmpgtdf_media, cmpgedf_media,cmpundf_media, negdf2_media): Likewise. (sqrtdf2_media, absdf2_media, extendsfdf2_media): Likewise. (truncdfsf2_media): Likewise. (movsi_media, movsi_media_nofpu, movdi_media): Use new types. (movdi_media_nofpui, movdf_media, movdf_media_nofpu): Likewise. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r55346
2002-07-10 00:04:34 +02:00
}
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
else if (REG_NOTE_KIND (link) == 0)
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
{
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
enum attr_type type;
rtx dep_set;
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
if (recog_memoized (insn) < 0
|| recog_memoized (dep_insn) < 0)
return cost;
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
dep_set = single_set (dep_insn);
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
/* The latency that we specify in the scheduling description refers
to the actual output, not to an auto-increment register; for that,
the latency is one. */
if (dep_set && MEM_P (SET_SRC (dep_set)) && cost > 1)
{
rtx set = single_set (insn);
if (set
&& !reg_mentioned_p (SET_DEST (dep_set), SET_SRC (set))
&& (!MEM_P (SET_DEST (set))
|| !reg_mentioned_p (SET_DEST (dep_set),
XEXP (SET_DEST (set), 0))))
cost = 1;
}
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 only input for a call that is timing-critical is the
function's address. */
if (CALL_P (insn))
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
{
rtx call = get_call_rtx_from (insn);
if (call
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* sibcalli_thunk uses a symbol_ref in an unspec. */
&& (GET_CODE (XEXP (XEXP (call, 0), 0)) == UNSPEC
|| ! reg_set_p (XEXP (XEXP (call, 0), 0), dep_insn)))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
cost -= TARGET_SH4_300 ? 3 : 6;
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
}
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
/* Likewise, the most timing critical input for an sfuncs call
is the function address. However, sfuncs typically start
using their arguments pretty quickly.
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
Assume a four cycle delay for SH4 before they are needed.
Cached ST40-300 calls are quicker, so assume only a one
cycle delay there.
??? Maybe we should encode the delays till input registers
are needed by sfuncs into the sfunc call insn. */
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
/* All sfunc calls are parallels with at least four components.
Exploit this to avoid unnecessary calls to sfunc_uses_reg. */
else if (GET_CODE (PATTERN (insn)) == PARALLEL
&& XVECLEN (PATTERN (insn), 0) >= 4
&& (reg = sfunc_uses_reg (insn)))
{
if (! reg_set_p (reg, dep_insn))
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
cost -= TARGET_SH4_300 ? 1 : 4;
}
if (TARGET_HARD_SH4 && !TARGET_SH4_300)
{
enum attr_type dep_type = get_attr_type (dep_insn);
if (dep_type == TYPE_FLOAD || dep_type == TYPE_PCFLOAD)
cost--;
else if ((dep_type == TYPE_LOAD_SI || dep_type == TYPE_PCLOAD_SI)
&& (type = get_attr_type (insn)) != TYPE_CALL
&& type != TYPE_SFUNC)
cost--;
/* When the preceding instruction loads the shift amount of
the following SHAD/SHLD, the latency of the load is increased
by 1 cycle. */
if (get_attr_type (insn) == TYPE_DYN_SHIFT
&& get_attr_any_int_load (dep_insn) == ANY_INT_LOAD_YES
&& reg_overlap_mentioned_p (SET_DEST (dep_set),
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
XEXP (SET_SRC (single_set (insn)),
1)))
cost++;
/* When an LS group instruction with a latency of less than
3 cycles is followed by a double-precision floating-point
instruction, FIPR, or FTRV, the latency of the first
instruction is increased to 3 cycles. */
else if (cost < 3
&& get_attr_insn_class (dep_insn) == INSN_CLASS_LS_GROUP
&& get_attr_dfp_comp (insn) == DFP_COMP_YES)
cost = 3;
/* The lsw register of a double-precision computation is ready one
cycle earlier. */
else if (reload_completed
&& get_attr_dfp_comp (dep_insn) == DFP_COMP_YES
&& (use_pat = single_set (insn))
&& ! regno_use_in (REGNO (SET_DEST (single_set (dep_insn))),
SET_SRC (use_pat)))
cost -= 1;
if (get_attr_any_fp_comp (dep_insn) == ANY_FP_COMP_YES
&& get_attr_late_fp_use (insn) == LATE_FP_USE_YES)
cost -= 1;
}
else if (TARGET_SH4_300)
{
/* Stores need their input register two cycles later. */
if (dep_set && cost >= 1
&& ((type = get_attr_type (insn)) == TYPE_STORE
|| type == TYPE_PSTORE
|| type == TYPE_FSTORE || type == TYPE_MAC_MEM))
{
rtx set = single_set (insn);
if (!reg_mentioned_p (SET_SRC (set), XEXP (SET_DEST (set), 0))
&& rtx_equal_p (SET_SRC (set), SET_DEST (dep_set)))
{
cost -= 2;
/* But don't reduce the cost below 1 if the address depends
on a side effect of dep_insn. */
if (cost < 1
&& modified_in_p (XEXP (SET_DEST (set), 0), dep_insn))
cost = 1;
}
}
}
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
}
/* An anti-dependence penalty of two applies if the first insn is a double
precision fadd / fsub / fmul. */
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
else if (!TARGET_SH4_300
&& REG_NOTE_KIND (link) == REG_DEP_ANTI
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
&& recog_memoized (dep_insn) >= 0
crt1.asm: Fix #ifdef indent. gcc: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * config/sh/crt1.asm: Fix #ifdef indent. 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> Merged from STMicroelectronics sources: 2006-10-06 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_600): Add missing #if. 2006-08-03 J"orn Rennecke <joern.rennecke@st.com> * sh.opt (mfused-madd): New option. * sh.md (mac_media, macsf3): Make conditional on TARGET_FMAC. 2006-07-04 Andrew Stubbs <andrew.stubbs@st.com> * config/sh/crt1.asm (vbr_start): Move to new section .test.vbr. Remove pointless handler at VBR+0. (vbr_200, vbr_300, vbr_500): Remove pointless handler. (vbr_600): Save and restore mach and macl, fpul and fpscr and fr0 to fr7. Make sure the timer handler is called with the correct FPU precision setting, according to the ABI. 2006-06-14 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.opt (m2a-single, m2a-single-only): Fix Condition. * config/sh/sh.h (SUPPORT_SH2A_NOFPU): Fix condition. (SUPPORT_SH2A_SINGLE_ONLY, SUPPORT_SH2A_SINGLE_ONLY): Likewise. 2006-06-09 J"orn Rennecke <joern.rennecke@st.com> * sh.md (cmpgeusi_t): Change into define_insn_and_split. Accept zero as second operand. 2006-04-28 J"orn Rennecke <joern.rennecke@st.com> * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: Fixed some bugs related to negative values, in particular -0 and overflow at -0x80000000. * config/sh/divcost-analysis: Added sh4-300 figures. 2006-04-27 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (MULTILIB_MATCHES): Add -m4-300* / -m4-340 options. 2006-04-26 J"orn Rennecke <joern.rennecke@st.com> * config/sh/t-sh (OPT_EXTRA_PARTS): Add libgcc-4-300.a. ($(T)div_table-4-300.o, $(T)libgcc-4-300.a): New rules. * config/sh/divtab-sh4-300.c, config/sh/lib1funcs-4-300.asm: New files. * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-4-300 for -m4-300* / -m4-340. 2006-04-24 J"orn Rennecke <joern.rennecke@st.com> SH4-300 scheduling description & fixes to SH4-[12]00 description: * sh.md: New instruction types: fstore, movi8, fpscr_toggle, gp_mac, mac_mem, mem_mac, dfp_mul, fp_cmp. (insn_class, dfp_comp, any_fp_comp): Update. (push_fpul, movsf_ie, fpu_switch, toggle_sz, toggle_pr): Update type. (cmpgtsf_t, "cmpeqsf_t, cmpgtsf_t_i4, cmpeqsf_t_i4): Likewise. (muldf3_i): Likewise. (movsi_i): Split rI08 alternative into two separate alternatives. Update type. (movsi_ie, movsi_i_lowpart): Likewise. (movqi_i): Split ri alternative into two separate alternatives. Update type. * sh1.md (sh1_load_store, sh1_fp): Update. * sh4.md (sh4_store, sh4_mac_gp, fp_arith, fp_double_arith): Update. (mac_mem, sh4_fpscr_toggle): New insn_reservations. * sh4a.md (sh4a_mov, sh4a_load, sh4a_store, sh4a_fp_arith): Update. (sh4a_fp_double_arith): Likewise. * sh4-300.md: New file. * sh.c (sh_handle_option): Handle m4-300* options. (sh_adjust_cost): Fix latency of auto-increments. Handle SH4-300 differently than other SH4s. Check for new insn types. * sh.h (OVERRIDE_OPTIONS): Initilize sh_branch_cost if it has not been set by an option. * sh.opt (m4-300, m4-100-nofpu, m4-200-nofpu): New options. (m4-300-nofpu, -m4-340, m4-300-single, m4-300-single-only): Likewise. (mbranch-cost=): Likewise. * superh.h (STARTFILE_SPEC): Take -m4-340 into account. * sh.md (mulsf3): Remove special expansion code. (mulsf3_ie): Now a define_insn_and_split. (macsf3): Allow for TARGET_SH4. * sh.md (cbranchsi4, cbranchdi4, cbranchdi4_i): New patterns. * sh.c (prepare_cbranch_operands, expand_cbranchsi4): New functions. (expand_cbranchdi4): Likewise. (sh_rtx_costs): Give lower cost for certain CONST_INT values and for CONST_DOUBLE if the outer code is COMPARE. * sh.h (OPTIMIZATION_OPTIONS): If not optimizing for size, set TARGET_CBRANCHDI4 and TARGET_EXPAND_CBRANCHDI4. (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, clear TARGET_CBRANCHDI4. (LEGITIMATE_CONSTANT_P): Also allow DImode and VOIDmode CONST_DOUBLEs. Remove redundant fp_{zero,one}_operand checks. * sh.opt (mcbranchdi, mexpand-cbranchdi, mcmpeqdi): New options. * sh-protos.h (prepare_cbranch_operands, expand_cbranchsi4): Declare. (expand_cbranchdi4): Likewise. 2006-04-20 J"orn Rennecke <joern.rennecke@st.com> * sh.h (LOCAL_ALIGNMENT): Use DATA_ALIGNMENT. gcc/testsuite: 2006-11-03 J"orn Rennecke <joern.rennecke@st.com> * testsuite/gcc.c-torture/execute/arith-rand-ll.c: Also test for bogus rest sign. From-SVN: r118458
2006-11-03 15:52:19 +01:00
&& (get_attr_type (dep_insn) == TYPE_DFP_ARITH
|| get_attr_type (dep_insn) == TYPE_DFP_MUL)
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
/* A lot of alleged anti-flow dependences are fake,
so check this one is real. */
&& flow_dependent_p (dep_insn, insn))
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
cost = 2;
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
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
return cost;
}
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
/* Check if INSN is flow-dependent on DEP_INSN. Can also be used to check
if DEP_INSN is anti-flow dependent on INSN. */
static bool
flow_dependent_p (rtx insn, rtx dep_insn)
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
{
rtx tmp = PATTERN (insn);
note_stores (PATTERN (dep_insn), flow_dependent_p_1, &tmp);
return tmp == NULL_RTX;
}
/* A helper function for flow_dependent_p called through note_stores. */
static void
alias.c (record_set, [...]): Constify. * alias.c (record_set, memory_modified_1): Constify. * bt-load.c (note_btr_set): Likewise. * caller-save.c (mark_set_regs, add_stored_regs): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, expand_field_assignment, record_dead_and_set_regs_1, use_crosses_set_p, reg_dead_at_p_1, can_combine_p, likely_spilled_retval_1): Likewise. * config/frv/frv.c (frv_registers_update_1, frv_io_check_address, frv_io_handle_set): Likewise. * config/mips/mips.c (mips_sim_record_set, vr4130_true_reg_dependence_p_1): Likewise. * config/mt/mt.c (insn_dependent_p_1): Likewise. * config/s390/s390.c (s390_reg_clobbered_rtx): Likewise. * config/sh/sh.c (flow_dependent_p_1): Likewise. * cselib.c (cselib_invalidate_rtx_note_stores): Likewise. * dce.c (mark_nonreg_stores_1, mark_nonreg_stores_2): Likewise. * ddg.c (mark_mem_store): Likewise. * df-problems.c (df_urec_mark_reg_change): Likewise. * function.c (update_epilogue_consts): Likewise. * gcse.c (record_set_info, record_last_set_info, mems_conflict_for_gcse_p, canon_list_insert, reg_set_info, reg_clear_last_set): Likewise. * global.c (mark_reg_store, mark_reg_clobber, reg_becomes_live): Likewise. * jump.c (reversed_comparison_code_parts): Likewise. * local-alloc.c (validate_equiv_mem_from_store, no_equiv, reg_is_set): Likewise. * loop-iv.c (mark_altered): Likewise. * mode-switching.c (reg_becomes_live): Likewise. * optabs.c (no_conflict_move_test): Likewise. * postreload-gcse.c (record_last_set_info, find_mem_conflicts): Likewise. * postreload.c (reload_combine_note_store, move2add_note_store): Likewise. * regmove.c (flags_set_1): Likewise. * regrename.c (note_sets, kill_clobbered_value, kill_set_value): Likewise. * reload1.c (mark_not_eliminable, forget_old_reloads_1): Likewise. * resource.c (update_live_status): Likewise. * rtl.h (set_of, note_stores): Likewise. * rtlanal.c (set_of_1, parms_set, struct set_of_data, set_of, note_stores, parms_set): Likewise. * sched-rgn.c (sets_likely_spilled_1): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. * var-tracking.c (count_stores, add_stores): Likewise. From-SVN: r127065
2007-07-30 18:30:18 +02:00
flow_dependent_p_1 (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
{
rtx * pinsn = (rtx *) data;
if (*pinsn && reg_referenced_p (x, *pinsn))
*pinsn = NULL_RTX;
}
/* For use by sh_allocate_initial_value. Note that sh.md contains some
'special function' patterns (type sfunc) that clobber pr, but that
do not look like function calls to leaf_function_p. Hence we must
do this extra check. */
static int
sh_pr_n_sets (void)
{
return DF_REG_DEF_COUNT (TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG);
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* Return where to allocate pseudo for a given hard register initial
value. */
static rtx
sh_allocate_initial_value (rtx hard_reg)
{
rtx x;
if (REGNO (hard_reg) == (TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG))
{
output.h: (current_function_is_leaf... * output.h: (current_function_is_leaf, current_function_sp_is_unchanging, current_function_uses_only_leaf_regs): Remove. * function.c (current_function_is_leaf, current_function_sp_is_unchanging, current_function_uses_only_leaf_regs): Remove. (rest_of_handle_check_leaf_regs): Set crtl->uses_only_leaf_regs instead of current_function_uses_only_leaf_regs. * function.h (struct rtl_data): New fields sp_is_unchanging, is_leaf, uses_only_leaf_regs. * resource.c (init_resource_info): Replace current_function_is_leaf, current_function_sp_is_unchanging, and current_function_uses_only_leaf_regs with new crtl fields. * sdbout.c (sdbout_symbol): Likewise. * df-core.c (rest_of_handle_df_initialize): Likewise. * ira.c (ira): Likewise. * final.c (final_start_function): Likewise. * reorg.c (fill_simple_delay_slots): Likewise. * regrename.c (check_new_reg_p): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. (notice_stack_pointer_modification): Likewise. * dbxout.c (dbxout_symbol): Likewise. (dbxout_parms): Likewise. * sel-sched.c (init_regs_for_mode): Likewise. * dwarf2out.c (dbx_reg_number): Likewise. (multiple_reg_loc_descriptor): Likewise. * config/i386/i386.c (ix86_frame_pointer_required): Likewise. (gen_pop): Likewise. (ix86_select_alt_pic_regnum): Likewise. (ix86_compute_frame_layout): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (ix86_expand_epilogue): Likewise. * config/rs6000/rs6000.c (rs6000_stack_info): Likewise. * config/h8300/h8300.c (byte_reg): Likewise. * config/c6x/c6x.c (must_reload_pic_reg_p): Likewise. (c6x_save_reg): Likewise. (c6x_compute_frame_layout): Likewise. * config/pa/pa.c (pa_compute_frame_size): Likewise. (pa_output_function_prologue): Likewise. * config/stormy16/stormy16.c (struct xstormy16_stack_layout): Likewise. * config/sparc/sparc.md (attr "leaf_function"): Likewise. * config/sparc/sparc.c (sparc_initial_elimination_offset): Likewise. (sparc_expand_prologue): Likewise. (sparc_flat_expand_prologue): Likewise. (sparc_asm_function_prologue): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. * config/epiphany/epiphany.c (epiphany_compute_function_type): Likewise. (epiphany_compute_frame_size): Likewise. * config/lm32/lm32.c (lm32_compute_frame_size): Likewise. * config/cris/cris.c (cris_md_asm_clobbers): Likewise. (cris_frame_pointer_required): Likewise. * config/tilepro/tilepro.c (emit_sp_adjust): Likewise. (tilepro_current_function_is_leaf): Likewise. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/ia64/ia64.c (find_gr_spill): Likewise. (ia64_compute_frame_size): Likewise. (ia64_can_eliminate): Likewise. (ia64_initial_elimination_offset): Likewise. * config/m68k/m68k.c (m68k_save_reg): Likewise. (m68k_expand_epilogue): Likewise. * config/rx/rx.c (rx_get_stack_layout): Likewise. * config/tilegx/tilegx.c (tilegx_current_function_is_leaf): Likewise. * config/picochip/picochip.c (picochip_can_eliminate_link_sp_save): Likewise. (picochip_output_frame_debug): Likewise. * config/sh/sh.c (sh_media_register_for_return): Likewise. (sh_allocate_initial_value): Likewise. (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_must_save_register): Likewise. (compute_frame_size): Likewise. (microblaze_initial_elimination_offset): Likewise. (microblaze_expand_prologue): Likewise. (microblaze_expand_epilogue): Likewise. * config/frv/frv.c (frv_expand_epilogue): Likewise. (frv_frame_pointer_required): Likewise. * config/spu/spu.c (get_pic_reg): Likewise. (direct_return): Likewise. (spu_expand_prologue): Likewise. (spu_expand_epilogue): Likewise. (spu_initial_elimination_offset): Likewise. * config/mips/mips.c (mips_global_pointer): Likewise. (mips_cfun_might_clobber_call_saved_reg_p): Likewise. (mips_compute_frame_info): Likewise. * config/mep/mep.c (mep_interrupt_saved_reg): Likewise. (mep_reload_pointer): Likewise. * config/rl78/rl78.c (need_to_save): Likewise. * config/cr16/cr16.c (cr16_compute_save_regs): Likewise. * config/score/score.c (score_compute_frame_size): Likewise. (score_function_prologue): Likewise. * config/bfin/bfin.c (must_save_p): Likewise. (expand_prologue_reg_save): Likewise. (expand_epilogue_reg_restore): Likewise. (bfin_frame_pointer_required): Likewise. (n_regs_saved_by_prologue): Likewise. (add_to_reg): Likewise. (expand_interrupt_handler_prologue): Likewise. (expand_interrupt_handler_epilogue): Likewise. (bfin_expand_prologue): Likewise. * config/avr/avr.c (avr_regs_to_save): Likewise. (avr_prologue_setup_frame): Likewise. (expand_epilogue): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. (s390_register_info): Likewise. (s390_frame_info): Likewise. (s390_init_frame_layout): Likewise. (s390_emit_prologue): Likewise. From-SVN: r188918
2012-06-24 19:58:46 +02:00
if (crtl->is_leaf
&& ! sh_pr_n_sets ()
&& ! (TARGET_SHCOMPACT
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->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
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->saves_all_registers)))
x = hard_reg;
else
x = gen_frame_mem (Pmode, return_address_pointer_rtx);
}
else
x = NULL_RTX;
return x;
}
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
/* This function returns "2" to indicate dual issue for the SH4
processor. To be used by the DFA pipeline description. */
static int
sh_issue_rate (void)
{
Scheduling revamp: * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn accordingly. (attribute insn_class): Provide default definitions based on type. Remove all insn-specific settings. (various function units): Remove old SH4 scheduling. (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): New attributes. Set them where appropriate. (cpu unit FS): Don't define / use. (F3, load_store): New cpu units. (F01): New reservation. (all insn_reservations): Make dependent on sh4 pipeline model. Fix latencies. (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. (mt insn_reservation): Use type mt_group. (insn_reservation load_store): Split into sh4_load, sh4_load_si, sh4_fload and sh4_store. (insn_reservation branch_zero and branch): Replace with sh4_branch. (insn_reservation branch_far): Replace with sh4_return. (insn_reservation return_from_exp): Rename to: (sh4_return_from_exp). Change to be just d_lock*5. (insn_reservation lds_to_pr): Rename to: (sh4_lds_to_pr). Change to be just d_lock*2. (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just d_lock*2. (insn_reservation prload_mem): Rename to: (sh4_prstore_mem). Change to d_lock*2,nothing,memory. (insn_reservation fpscr_store): Rename to: (fpscr_load). Change to d_lock,nothing,F1*3. (insn_reservation fpscr_store_mem): Rename to: (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. (insn_reservation multi): Change to d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. (insn_reservation fp_arith): Change to issue,F01,F2. (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. (insn_reservation fp_double_cmp): Change to d_lock,(d_lock+F01),F1+F2,F2. (insn_reservation dp_div): Change to issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. (sh_adjust_cost, SHcompact): Differentiate between different kinds of dependencies. Drop factor of ten for superscalar. Use new instruction types. Add new exception rules. Two small bug fixes: * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. * sh.md (mperm_w): Add DONE. From-SVN: r56601
2002-08-27 17:31:02 +02:00
if (TARGET_SUPERSCALAR)
return 2;
else
return 1;
}
/* Functions for ready queue reordering for sched1. */
/* Get weight for mode for a set x. */
static short
find_set_regmode_weight (rtx x, enum machine_mode mode)
{
if (GET_CODE (x) == CLOBBER && register_operand (SET_DEST (x), mode))
return 1;
if (GET_CODE (x) == SET && register_operand (SET_DEST (x), mode))
{
if (REG_P (SET_DEST (x)))
{
if (!reg_mentioned_p (SET_DEST (x), SET_SRC (x)))
return 1;
else
return 0;
}
return 1;
}
return 0;
}
/* Get regmode weight for insn. */
static short
find_insn_regmode_weight (rtx insn, enum machine_mode mode)
{
short reg_weight = 0;
rtx x;
/* Increment weight for each register born here. */
x = PATTERN (insn);
reg_weight += find_set_regmode_weight (x, mode);
if (GET_CODE (x) == PARALLEL)
{
int j;
for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
{
x = XVECEXP (PATTERN (insn), 0, j);
reg_weight += find_set_regmode_weight (x, mode);
}
}
/* Decrement weight for each register that dies here. */
for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
{
if (REG_NOTE_KIND (x) == REG_DEAD || REG_NOTE_KIND (x) == REG_UNUSED)
{
rtx note = XEXP (x, 0);
if (REG_P (note) && GET_MODE (note) == mode)
reg_weight--;
}
}
return reg_weight;
}
/* Calculate regmode weights for all insns of a basic block. */
static void
find_regmode_weight (basic_block b, enum machine_mode mode)
{
rtx insn, next_tail, head, tail;
get_ebb_head_tail (b, b, &head, &tail);
next_tail = NEXT_INSN (tail);
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
{
/* Handle register life information. */
if (!INSN_P (insn))
continue;
if (mode == SFmode)
INSN_REGMODE_WEIGHT (insn, mode) =
find_insn_regmode_weight (insn, mode) + 2 * find_insn_regmode_weight (insn, DFmode);
else if (mode == SImode)
INSN_REGMODE_WEIGHT (insn, mode) =
find_insn_regmode_weight (insn, mode) + 2 * find_insn_regmode_weight (insn, DImode);
}
}
/* Comparison function for ready queue sorting. */
static int
rank_for_reorder (const void *x, const void *y)
{
rtx tmp = *(const rtx *) y;
rtx tmp2 = *(const rtx *) x;
/* The insn in a schedule group should be issued the first. */
if (SCHED_GROUP_P (tmp) != SCHED_GROUP_P (tmp2))
return SCHED_GROUP_P (tmp2) ? 1 : -1;
/* If insns are equally good, sort by INSN_LUID (original insn order), This
minimizes instruction movement, thus minimizing sched's effect on
register pressure. */
return INSN_LUID (tmp) - INSN_LUID (tmp2);
}
/* Resort the array A in which only element at index N may be out of order. */
static void
swap_reorder (rtx *a, int n)
{
rtx insn = a[n - 1];
int i = n - 2;
while (i >= 0 && rank_for_reorder (a + i, &insn) >= 0)
{
a[i + 1] = a[i];
i -= 1;
}
a[i + 1] = insn;
}
/* Sort the ready list by ascending priority. */
static void
ready_reorder (rtx *ready, int nready)
{
if (nready == 2)
swap_reorder (ready, nready);
else if (nready > 2)
qsort (ready, nready, sizeof (rtx), rank_for_reorder);
}
/* Count life regions of r0 for a block. */
static int
find_r0_life_regions (basic_block b)
{
rtx end, insn;
rtx pset;
rtx r0_reg;
int live;
int set;
int death = 0;
df.h (DF_FIRST_OPTIONAL_PROBLEM): Removed. 2007-06-15 Kenneth Zadeck <zadeck@naturalbridge.com> * df.h (DF_FIRST_OPTIONAL_PROBLEM): Removed. (struct df_problem.free_blocks_on_set_blocks): New field. (struct dataflow.optional_p): New field. (df_bb_regno_last_use_find, df_insn_regno_def_p): Removed. (df_live_set_all_dirty): New function. * df-scan.c (df_scan_alloc): Initialize optional_p. (problem_SCAN): Initialize free_blocks_on_set_blocks. * df-core.c (df_set_blocks): Removed use of DF_FIRST_OPTIONAL_PROBLEM. Now uses df_problem.free_blocks_on_set_blocks to determine which blocks are recycled. (df_remove_problem): Removed use of DF_FIRST_OPTIONAL_PROBLEM. (df_finish_pass): Removed use of DF_FIRST_OPTIONAL_PROBLEM. Now uses dataflow.optional_p to determine if problem should be deleted. (rest_of_handle_df_initialize): Only start live problem if -02 or above. (df_bb_regno_last_use_find, df_insn_regno_def_p): Removed. * df-problems.c (df_ru_alloc, df_rd_alloc, df_lr_alloc, df_live_alloc, df_urec_alloc, df_note_alloc): set optional_p. (problem_RU, problem_RD, problem_LR, problem_UREC, problem_CHAIN, problem_NOTE): Initialize free_blocks_on_set_blocks. (df_lr_bb_local_compute): Recompute luids if df_live problem is not active. (df_live_set_all_dirty, df_note_alloc): New function. * regrename.c (merge_overlapping_regs): Change DF_LIVE_* to df_get_live_*. * sched_ebb.c (compute_jump_reg_dependencies): Ditto. * postreload.c (reload_combine): Ditto. * cse.c (cse_extended_basic_block): Ditto. * regmove.c (mark_flags_life_zones): Ditto. * rtlfactoring.c (split_blocks_after_seqs, split_pattern_seq, erase_matching_seqs): Ditto. * bt-load.c (compute_defs_uses_and_gen): Ditto. * integrate (allocate_initial_values): Ditto. * combine.c (reg_dead_at_p): Ditto. * resource.c (mark_target_live_regs): Ditto. * sched-rgn.c (check_live_1, update_live_1): Ditto. * config/sh/sh.c (find_r0_life_regions): Ditto. * global.c (rest_of_handle_global_alloc): Only add back df_live for -O > 1. * local-alloc.c (rest_of_handle_local_alloc): Only remove df_live for -O > 1. * ifcvt.c (dead_or_predicable): Change DF_LIVE_* to df_get_live_*. (if_convert): Make sure df_live is there at -O == 1. (pass_if_after_combine): Cleanup flags. * init-regs.c (initialize_uninitialized_regs): Make sure df_live is there at -O == 1. From-SVN: r125857
2007-06-19 21:04:52 +02:00
if (REGNO_REG_SET_P (df_get_live_in (b), R0_REG))
{
set = 1;
live = 1;
}
else
{
set = 0;
live = 0;
}
insn = BB_HEAD (b);
end = BB_END (b);
r0_reg = gen_rtx_REG (SImode, R0_REG);
while (1)
{
if (INSN_P (insn))
{
if (find_regno_note (insn, REG_DEAD, R0_REG))
{
death++;
live = 0;
}
if (!live
&& (pset = single_set (insn))
&& reg_overlap_mentioned_p (r0_reg, SET_DEST (pset))
&& !find_regno_note (insn, REG_UNUSED, R0_REG))
{
set++;
live = 1;
}
}
if (insn == end)
break;
insn = NEXT_INSN (insn);
}
return set - death;
}
/* Calculate regmode weights for all insns of all basic block. */
static void
sh_md_init_global (FILE *dump ATTRIBUTE_UNUSED,
int verbose ATTRIBUTE_UNUSED,
int old_max_uid)
{
basic_block b;
regmode_weight[0] = (short *) xcalloc (old_max_uid, sizeof (short));
regmode_weight[1] = (short *) xcalloc (old_max_uid, sizeof (short));
r0_life_regions = 0;
FOR_EACH_BB_REVERSE (b)
{
find_regmode_weight (b, SImode);
find_regmode_weight (b, SFmode);
if (!reload_completed)
r0_life_regions += find_r0_life_regions (b);
}
CURR_REGMODE_PRESSURE (SImode) = 0;
CURR_REGMODE_PRESSURE (SFmode) = 0;
}
/* Cleanup. */
static void
sh_md_finish_global (FILE *dump ATTRIBUTE_UNUSED,
int verbose ATTRIBUTE_UNUSED)
{
if (regmode_weight[0])
{
free (regmode_weight[0]);
regmode_weight[0] = NULL;
}
if (regmode_weight[1])
{
free (regmode_weight[1]);
regmode_weight[1] = NULL;
}
}
/* The scalar modes supported differs from the default version in TImode
for 32-bit SHMEDIA. */
static bool
sh_scalar_mode_supported_p (enum machine_mode mode)
{
if (TARGET_SHMEDIA32 && mode == TImode)
return false;
return default_scalar_mode_supported_p (mode);
}
/* Cache the can_issue_more so that we can return it from reorder2. Also,
keep count of register pressures on SImode and SFmode. */
static int
sh_variable_issue (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
rtx insn,
int can_issue_more)
{
if (GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER)
cached_can_issue_more = can_issue_more - 1;
else
cached_can_issue_more = can_issue_more;
if (reload_completed)
return cached_can_issue_more;
CURR_REGMODE_PRESSURE (SImode) += INSN_REGMODE_WEIGHT (insn, SImode);
CURR_REGMODE_PRESSURE (SFmode) += INSN_REGMODE_WEIGHT (insn, SFmode);
return cached_can_issue_more;
}
static void
sh_md_init (FILE *dump ATTRIBUTE_UNUSED,
int verbose ATTRIBUTE_UNUSED,
int veclen ATTRIBUTE_UNUSED)
{
CURR_REGMODE_PRESSURE (SImode) = 0;
CURR_REGMODE_PRESSURE (SFmode) = 0;
}
/* Some magic numbers. */
/* Pressure on register r0 can lead to spill failures. so avoid sched1 for
functions that already have high pressure on r0. */
#define R0_MAX_LIFE_REGIONS 2
/* Register Pressure thresholds for SImode and SFmode registers. */
#define SIMODE_MAX_WEIGHT 5
#define SFMODE_MAX_WEIGHT 10
/* Return true if the pressure is high for MODE. */
static bool
high_pressure (enum machine_mode mode)
{
/* Pressure on register r0 can lead to spill failures. so avoid sched1 for
functions that already have high pressure on r0. */
if (r0_life_regions >= R0_MAX_LIFE_REGIONS)
return true;
if (mode == SFmode)
return (CURR_REGMODE_PRESSURE (SFmode) > SFMODE_MAX_WEIGHT);
else
return (CURR_REGMODE_PRESSURE (SImode) > SIMODE_MAX_WEIGHT);
}
/* Reorder ready queue if register pressure is high. */
static int
sh_reorder (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
rtx *ready,
int *n_readyp,
int clock_var ATTRIBUTE_UNUSED)
{
if (reload_completed)
return sh_issue_rate ();
if (high_pressure (SFmode) || high_pressure (SImode))
{
ready_reorder (ready, *n_readyp);
}
return sh_issue_rate ();
}
/* Skip cycles if the current register pressure is high. */
static int
sh_reorder2 (FILE *dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
rtx *ready ATTRIBUTE_UNUSED,
int *n_readyp ATTRIBUTE_UNUSED,
int clock_var ATTRIBUTE_UNUSED)
{
if (reload_completed)
return cached_can_issue_more;
if (high_pressure(SFmode) || high_pressure (SImode))
skip_cycles = 1;
return cached_can_issue_more;
}
/* Skip cycles without sorting the ready queue. This will move insn from
Q->R. If this is the last cycle we are skipping; allow sorting of ready
queue by sh_reorder. */
/* Generally, skipping these many cycles are sufficient for all insns to move
from Q -> R. */
#define MAX_SKIPS 8
static int
sh_dfa_new_cycle (FILE *sched_dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
rtx insn ATTRIBUTE_UNUSED,
int last_clock_var,
int clock_var,
int *sort_p)
{
if (reload_completed)
return 0;
if (skip_cycles)
{
if ((clock_var - last_clock_var) < MAX_SKIPS)
{
*sort_p = 0;
return 1;
}
/* If this is the last cycle we are skipping, allow reordering of R. */
if ((clock_var - last_clock_var) == MAX_SKIPS)
{
*sort_p = 1;
return 1;
}
}
skip_cycles = 0;
return 0;
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
/* SHmedia requires registers for branches, so we can't generate new
branches past reload. */
static bool
sh_cannot_modify_jumps_p (void)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
return (TARGET_SHMEDIA && (reload_in_progress || reload_completed));
}
re PR middle-end/44566 (configuration with multiple targets / backends is not supported.) PR other/44566 * coretypes.h [!USED_FOR_TARGET] (reg_class_t): Define. * target.def (struct gcc_target): Replace enum reg_class with reg_class_t in hook argument / return types. * doc/tm.texi.in (TARGET_SECONDARY_RELOAD): Likewise. (TARGET_IRA_COVER_CLASSES, TARGET_MEMORY_MOVE_COST): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise. * targhooks.h (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * targhooks.c (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * reload.c (push_secondary_reload, secondary_reload_class): Likewise. * bt-load.c (branch_target_load_optimize): Likewise. * ira.c (setup_cover_and_important_classes): Likewise. * ira-costs.c (copy_cost): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_secondary_reload): Likewise. * config/s390/s390.c (s390_secondary_reload): Likewise. * config/i386/i386.c (i386_ira_cover_classes): Likewise. (ix86_secondary_reload, ix86_memory_move_cost): Likewise. (ix86_register_move_cost): Likewise. * config/sh/sh-protos.h (sh_secondary_reload): Likewise. * config/sh/sh.c (sh_target_reg_class, sh_secondary_reload): Likewise. * config/xtensa/xtensa.c (xtensa_secondary_reload): Likewise. * config/xtensa/xtensa-protos.h (xtensa_secondary_reload): Likewise. * config/rs6000/rs6000.c (rs6000_secondary_reload): Likewise. (rs6000_ira_cover_classes): Likewise. * config/picochip/picochip.c (picochip_secondary_reload): Likewise. * config/picochip/picochip-protos.h (picochip_secondary_reload): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * config/mips/mips.c (mips_ira_cover_classes): Likewise. * config/bfin/bfin.c (bfin_secondary_reload): Likewise. * config/ia64/ia64.c (ia64_register_move_cost): Likewise. * doc/tm.texi: Regenerate. From-SVN: r161633
2010-06-30 20:47:43 +02:00
static reg_class_t
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
sh_target_reg_class (void)
{
return TARGET_SHMEDIA ? TARGET_REGS : NO_REGS;
}
static bool
sh_optimize_target_register_callee_saved (bool after_prologue_epilogue_gen)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
HARD_REG_SET dummy;
#if 0
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
rtx insn;
#endif
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (! shmedia_space_reserved_for_target_registers)
return 0;
if (after_prologue_epilogue_gen && ! TARGET_SAVE_ALL_TARGET_REGS)
return 0;
if (calc_live_regs (&dummy) >= 6 * 8)
return 1;
return 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
}
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01: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
sh_ms_bitfield_layout_p (const_tree record_type ATTRIBUTE_UNUSED)
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
{
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
return (TARGET_SH5 || TARGET_HITACHI || sh_attr_renesas_p (record_type));
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
}
/*
On the SH1..SH4, the trampoline looks like
2 0002 D202 mov.l l2,r2
1 0000 D301 mov.l l1,r3
3 0004 422B jmp @r2
4 0006 0009 nop
5 0008 00000000 l1: .long area
6 000c 00000000 l2: .long function
SH5 (compact) uses r1 instead of r3 for the static chain. */
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
static void
sh_trampoline_init (rtx tramp_mem, tree fndecl, rtx cxt)
{
rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
rtx tramp = force_reg (Pmode, XEXP (tramp_mem, 0));
if (TARGET_SHMEDIA64)
{
rtx tramp_templ;
int fixed_len;
rtx movi1 = GEN_INT (0xcc000010);
rtx shori1 = GEN_INT (0xc8000010);
rtx src, dst;
/* The following trampoline works within a +- 128 KB range for cxt:
ptb/u cxt,tr1; movi fnaddr >> 48,r0; shori fnaddr >> 32,r0;
shori fnaddr >> 16,r0; shori fnaddr,r0; ptabs/l r0,tr0
gettr tr1,r1; blink tr0,r63 */
/* Address rounding makes it hard to compute the exact bounds of the
offset for this trampoline, but we have a rather generous offset
range, so frame_offset should do fine as an upper bound. */
if (cxt == virtual_stack_vars_rtx && frame_offset < 0x20000)
{
/* ??? could optimize this trampoline initialization
by writing DImode words with two insns each. */
rtx mask = force_reg (DImode, GEN_INT (0x3fffc00));
rtx insn = gen_rtx_MINUS (DImode, cxt, tramp);
insn = gen_rtx_ASHIFT (DImode, insn, GEN_INT (10-2));
insn = gen_rtx_AND (DImode, insn, mask);
/* Or in ptb/u .,tr1 pattern */
insn = gen_rtx_IOR (DImode, insn, gen_int_mode (0xec000010, SImode));
insn = force_operand (insn, NULL_RTX);
insn = gen_lowpart (SImode, insn);
emit_move_insn (change_address (tramp_mem, SImode, NULL_RTX), insn);
insn = gen_rtx_LSHIFTRT (DImode, fnaddr, GEN_INT (38));
insn = gen_rtx_AND (DImode, insn, mask);
insn = force_operand (gen_rtx_IOR (DImode, movi1, insn), NULL_RTX);
insn = gen_lowpart (SImode, insn);
emit_move_insn (adjust_address (tramp_mem, SImode, 4), insn);
insn = gen_rtx_LSHIFTRT (DImode, fnaddr, GEN_INT (22));
insn = gen_rtx_AND (DImode, insn, mask);
insn = force_operand (gen_rtx_IOR (DImode, shori1, insn), NULL_RTX);
insn = gen_lowpart (SImode, insn);
emit_move_insn (adjust_address (tramp_mem, SImode, 8), insn);
insn = gen_rtx_LSHIFTRT (DImode, fnaddr, GEN_INT (6));
insn = gen_rtx_AND (DImode, insn, mask);
insn = force_operand (gen_rtx_IOR (DImode, shori1, insn), NULL_RTX);
insn = gen_lowpart (SImode, insn);
emit_move_insn (adjust_address (tramp_mem, SImode, 12), insn);
insn = gen_rtx_ASHIFT (DImode, fnaddr, GEN_INT (10));
insn = gen_rtx_AND (DImode, insn, mask);
insn = force_operand (gen_rtx_IOR (DImode, shori1, insn), NULL_RTX);
insn = gen_lowpart (SImode, insn);
emit_move_insn (adjust_address (tramp_mem, SImode, 16), insn);
emit_move_insn (adjust_address (tramp_mem, SImode, 20),
GEN_INT (0x6bf10600));
emit_move_insn (adjust_address (tramp_mem, SImode, 24),
GEN_INT (0x4415fc10));
emit_move_insn (adjust_address (tramp_mem, SImode, 28),
GEN_INT (0x4401fff0));
emit_insn (gen_ic_invalidate_line (tramp));
return;
}
tramp_templ = gen_rtx_SYMBOL_REF (Pmode,"__GCC_nested_trampoline");
fixed_len = TRAMPOLINE_SIZE - 2 * GET_MODE_SIZE (Pmode);
tramp_templ = gen_datalabel_ref (tramp_templ);
dst = tramp_mem;
src = gen_const_mem (BLKmode, tramp_templ);
set_mem_align (dst, 256);
set_mem_align (src, 64);
emit_block_move (dst, src, GEN_INT (fixed_len), BLOCK_OP_NORMAL);
emit_move_insn (adjust_address (tramp_mem, Pmode, fixed_len), fnaddr);
emit_move_insn (adjust_address (tramp_mem, Pmode,
fixed_len + GET_MODE_SIZE (Pmode)),
cxt);
emit_insn (gen_ic_invalidate_line (tramp));
return;
}
else if (TARGET_SHMEDIA)
{
/* movi fnaddr >> 16,r1; shori fnaddr,r1; ptabs/l r1,tr0
movi cxt >> 16,r1; shori cxt,r1; blink tr0,r63 */
rtx quad0 = gen_reg_rtx (DImode), cxtload = gen_reg_rtx (DImode);
rtx quad1 = gen_reg_rtx (DImode), quad2 = gen_reg_rtx (DImode);
/* movi 0,r1: 0xcc000010 shori 0,r1: c8000010 concatenated,
rotated 10 right, and higher 16 bit of every 32 selected. */
rtx movishori
= force_reg (V2HImode, (simplify_gen_subreg
(V2HImode, GEN_INT (0x4330432), SImode, 0)));
rtx ptabs = force_reg (DImode, GEN_INT (0x6bf10600));
rtx blink = force_reg (DImode, GEN_INT (0x4401fff0));
fnaddr = force_reg (SImode, fnaddr);
cxt = force_reg (SImode, cxt);
emit_insn (gen_mshflo_w_x (gen_rtx_SUBREG (V4HImode, quad0, 0),
gen_rtx_SUBREG (V2HImode, fnaddr, 0),
movishori));
emit_insn (gen_rotrdi3_mextr (quad0, quad0,
GEN_INT (TARGET_LITTLE_ENDIAN ? 24 : 56)));
emit_insn (gen_ashldi3_media (quad0, quad0, const2_rtx));
emit_move_insn (change_address (tramp_mem, DImode, NULL_RTX), quad0);
emit_insn (gen_mshflo_w_x (gen_rtx_SUBREG (V4HImode, cxtload, 0),
gen_rtx_SUBREG (V2HImode, cxt, 0),
movishori));
emit_insn (gen_rotrdi3_mextr (cxtload, cxtload,
GEN_INT (TARGET_LITTLE_ENDIAN ? 24 : 56)));
emit_insn (gen_ashldi3_media (cxtload, cxtload, const2_rtx));
if (TARGET_LITTLE_ENDIAN)
{
emit_insn (gen_mshflo_l_di (quad1, ptabs, cxtload));
emit_insn (gen_mextr4 (quad2, cxtload, blink));
}
else
{
emit_insn (gen_mextr4 (quad1, cxtload, ptabs));
emit_insn (gen_mshflo_l_di (quad2, blink, cxtload));
}
emit_move_insn (adjust_address (tramp_mem, DImode, 8), quad1);
emit_move_insn (adjust_address (tramp_mem, DImode, 16), quad2);
emit_insn (gen_ic_invalidate_line (tramp));
return;
}
else if (TARGET_SHCOMPACT)
{
emit_insn (gen_initialize_trampoline (tramp, cxt, fnaddr));
return;
}
emit_move_insn (change_address (tramp_mem, SImode, NULL_RTX),
gen_int_mode (TARGET_LITTLE_ENDIAN ? 0xd301d202 : 0xd202d301,
SImode));
emit_move_insn (adjust_address (tramp_mem, SImode, 4),
gen_int_mode (TARGET_LITTLE_ENDIAN ? 0x0009422b : 0x422b0009,
SImode));
emit_move_insn (adjust_address (tramp_mem, SImode, 8), cxt);
emit_move_insn (adjust_address (tramp_mem, SImode, 12), fnaddr);
if (TARGET_HARVARD)
{
if (!TARGET_INLINE_IC_INVALIDATE
|| (!(TARGET_SH4A_ARCH || TARGET_SH4_300) && TARGET_USERMODE))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
emit_library_call (function_symbol (NULL, "__ic_invalidate",
FUNCTION_ORDINARY),
LCT_NORMAL, VOIDmode, 1, tramp, SImode);
else
emit_insn (gen_ic_invalidate_line (tramp));
}
}
/* On SH5, trampolines are SHmedia code, so add 1 to the address. */
static rtx
sh_trampoline_adjust_address (rtx tramp)
{
if (TARGET_SHMEDIA)
tramp = expand_simple_binop (Pmode, PLUS, tramp, const1_rtx,
gen_reg_rtx (Pmode), 0, OPTAB_LIB_WIDEN);
return tramp;
}
/* FIXME: This is overly conservative. A SHcompact function that
receives arguments ``by reference'' will have them stored in its
own stack frame, so it must not pass pointers or references to
these arguments to other functions by means of sibling calls. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* If PIC, we cannot make sibling calls to global functions
because the PLT requires r12 to be live. */
static bool
sh_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
return (1
&& (! TARGET_SHCOMPACT
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->args.info.stack_regs == 0)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
&& ! sh_cfun_interrupt_handler_p ()
&& (! flag_pic
|| (decl && ! TREE_PUBLIC (decl))
|| (decl && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT)));
}
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
/* Machine specific built-in functions. */
struct builtin_description
{
bool (* const is_enabled) (void);
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
const enum insn_code icode;
const char *const name;
int signature;
tree fndecl;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
};
static bool
shmedia_builtin_p (void)
{
return TARGET_SHMEDIA;
}
/* This function can be used if there are any built-ins that are not for
SHmedia. It's commented out to avoid the defined-but-unused warning.
static bool
sh1_builtin_p (void)
{
return TARGET_SH1;
}
*/
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
/* describe number and signedness of arguments; arg[0] == result
(1: unsigned, 2: signed, 4: don't care, 8: pointer 0: no argument */
/* 9: 64-bit pointer, 10: 32-bit pointer */
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
static const char signature_args[][4] =
{
#define SH_BLTIN_V2SI2 0
{ 4, 4 },
#define SH_BLTIN_V4HI2 1
{ 4, 4 },
#define SH_BLTIN_V2SI3 2
{ 4, 4, 4 },
#define SH_BLTIN_V4HI3 3
{ 4, 4, 4 },
#define SH_BLTIN_V8QI3 4
{ 4, 4, 4 },
#define SH_BLTIN_MAC_HISI 5
{ 1, 4, 4, 1 },
#define SH_BLTIN_SH_HI 6
{ 4, 4, 1 },
#define SH_BLTIN_SH_SI 7
{ 4, 4, 1 },
#define SH_BLTIN_V4HI2V2SI 8
{ 4, 4, 4 },
#define SH_BLTIN_V4HI2V8QI 9
{ 4, 4, 4 },
#define SH_BLTIN_SISF 10
{ 4, 2 },
#define SH_BLTIN_LDUA_L 11
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{ 2, 10 },
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
#define SH_BLTIN_LDUA_Q 12
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{ 1, 10 },
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
#define SH_BLTIN_STUA_L 13
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{ 0, 10, 2 },
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
#define SH_BLTIN_STUA_Q 14
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{ 0, 10, 1 },
#define SH_BLTIN_LDUA_L64 15
{ 2, 9 },
#define SH_BLTIN_LDUA_Q64 16
{ 1, 9 },
#define SH_BLTIN_STUA_L64 17
{ 0, 9, 2 },
#define SH_BLTIN_STUA_Q64 18
{ 0, 9, 1 },
#define SH_BLTIN_NUM_SHARED_SIGNATURES 19
#define SH_BLTIN_2 19
#define SH_BLTIN_SU 19
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{ 1, 2 },
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
#define SH_BLTIN_3 20
#define SH_BLTIN_SUS 20
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{ 2, 2, 1 },
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
#define SH_BLTIN_PSSV 21
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{ 0, 8, 2, 2 },
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
#define SH_BLTIN_XXUU 22
#define SH_BLTIN_UUUU 22
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{ 1, 1, 1, 1 },
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
#define SH_BLTIN_PV 23
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{ 0, 8 },
#define SH_BLTIN_VP 24
{ 8, 0 },
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
};
/* mcmv: operands considered unsigned. */
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
/* mmulsum_wq, msad_ubq: result considered unsigned long long. */
/* mperm: control value considered unsigned int. */
/* mshalds, mshard, mshards, mshlld, mshlrd: shift count is unsigned int. */
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
/* mshards_q: returns signed short. */
/* nsb: takes long long arg, returns unsigned char. */
static struct builtin_description bdesc[] =
{
{ shmedia_builtin_p,
CODE_FOR_absv2si2, "__builtin_absv2si2", SH_BLTIN_V2SI2, 0 },
{ shmedia_builtin_p,
CODE_FOR_absv4hi2, "__builtin_absv4hi2", SH_BLTIN_V4HI2, 0 },
{ shmedia_builtin_p,
CODE_FOR_addv2si3, "__builtin_addv2si3", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_addv4hi3, "__builtin_addv4hi3", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_ssaddv2si3,"__builtin_ssaddv2si3", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_usaddv8qi3,"__builtin_usaddv8qi3", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_ssaddv4hi3,"__builtin_ssaddv4hi3", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_alloco_i, "__builtin_sh_media_ALLOCO", SH_BLTIN_PV, 0 },
{ shmedia_builtin_p,
CODE_FOR_negcmpeqv8qi,"__builtin_sh_media_MCMPEQ_B", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_negcmpeqv2si,"__builtin_sh_media_MCMPEQ_L", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_negcmpeqv4hi,"__builtin_sh_media_MCMPEQ_W", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_negcmpgtuv8qi,"__builtin_sh_media_MCMPGT_UB", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_negcmpgtv2si,"__builtin_sh_media_MCMPGT_L", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_negcmpgtv4hi,"__builtin_sh_media_MCMPGT_W", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mcmv, "__builtin_sh_media_MCMV", SH_BLTIN_UUUU, 0 },
{ shmedia_builtin_p,
CODE_FOR_mcnvs_lw, "__builtin_sh_media_MCNVS_LW", SH_BLTIN_3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mcnvs_wb, "__builtin_sh_media_MCNVS_WB", SH_BLTIN_V4HI2V8QI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mcnvs_wub, "__builtin_sh_media_MCNVS_WUB", SH_BLTIN_V4HI2V8QI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mextr1, "__builtin_sh_media_MEXTR1", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mextr2, "__builtin_sh_media_MEXTR2", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mextr3, "__builtin_sh_media_MEXTR3", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mextr4, "__builtin_sh_media_MEXTR4", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mextr5, "__builtin_sh_media_MEXTR5", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mextr6, "__builtin_sh_media_MEXTR6", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mextr7, "__builtin_sh_media_MEXTR7", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmacfx_wl, "__builtin_sh_media_MMACFX_WL", SH_BLTIN_MAC_HISI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmacnfx_wl,"__builtin_sh_media_MMACNFX_WL", SH_BLTIN_MAC_HISI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mulv2si3, "__builtin_mulv2si3", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mulv4hi3, "__builtin_mulv4hi3", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmulfx_l, "__builtin_sh_media_MMULFX_L", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmulfx_w, "__builtin_sh_media_MMULFX_W", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmulfxrp_w,"__builtin_sh_media_MMULFXRP_W", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmulhi_wl, "__builtin_sh_media_MMULHI_WL", SH_BLTIN_V4HI2V2SI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmullo_wl, "__builtin_sh_media_MMULLO_WL", SH_BLTIN_V4HI2V2SI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mmulsum_wq,"__builtin_sh_media_MMULSUM_WQ", SH_BLTIN_XXUU, 0 },
{ shmedia_builtin_p,
CODE_FOR_mperm_w, "__builtin_sh_media_MPERM_W", SH_BLTIN_SH_HI, 0 },
{ shmedia_builtin_p,
CODE_FOR_msad_ubq, "__builtin_sh_media_MSAD_UBQ", SH_BLTIN_XXUU, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshalds_l, "__builtin_sh_media_MSHALDS_L", SH_BLTIN_SH_SI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshalds_w, "__builtin_sh_media_MSHALDS_W", SH_BLTIN_SH_HI, 0 },
{ shmedia_builtin_p,
CODE_FOR_ashrv2si3, "__builtin_ashrv2si3", SH_BLTIN_SH_SI, 0 },
{ shmedia_builtin_p,
CODE_FOR_ashrv4hi3, "__builtin_ashrv4hi3", SH_BLTIN_SH_HI, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshards_q, "__builtin_sh_media_MSHARDS_Q", SH_BLTIN_SUS, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshfhi_b, "__builtin_sh_media_MSHFHI_B", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshfhi_l, "__builtin_sh_media_MSHFHI_L", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshfhi_w, "__builtin_sh_media_MSHFHI_W", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshflo_b, "__builtin_sh_media_MSHFLO_B", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshflo_l, "__builtin_sh_media_MSHFLO_L", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_mshflo_w, "__builtin_sh_media_MSHFLO_W", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_ashlv2si3, "__builtin_ashlv2si3", SH_BLTIN_SH_SI, 0 },
{ shmedia_builtin_p,
CODE_FOR_ashlv4hi3, "__builtin_ashlv4hi3", SH_BLTIN_SH_HI, 0 },
{ shmedia_builtin_p,
CODE_FOR_lshrv2si3, "__builtin_lshrv2si3", SH_BLTIN_SH_SI, 0 },
{ shmedia_builtin_p,
CODE_FOR_lshrv4hi3, "__builtin_lshrv4hi3", SH_BLTIN_SH_HI, 0 },
{ shmedia_builtin_p,
CODE_FOR_subv2si3, "__builtin_subv2si3", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_subv4hi3, "__builtin_subv4hi3", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_sssubv2si3,"__builtin_sssubv2si3", SH_BLTIN_V2SI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_ussubv8qi3,"__builtin_ussubv8qi3", SH_BLTIN_V8QI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_sssubv4hi3,"__builtin_sssubv4hi3", SH_BLTIN_V4HI3, 0 },
{ shmedia_builtin_p,
CODE_FOR_fcosa_s, "__builtin_sh_media_FCOSA_S", SH_BLTIN_SISF, 0 },
{ shmedia_builtin_p,
CODE_FOR_fsina_s, "__builtin_sh_media_FSINA_S", SH_BLTIN_SISF, 0 },
{ shmedia_builtin_p,
CODE_FOR_fipr, "__builtin_sh_media_FIPR_S", SH_BLTIN_3, 0 },
{ shmedia_builtin_p,
CODE_FOR_ftrv, "__builtin_sh_media_FTRV_S", SH_BLTIN_3, 0 },
{ shmedia_builtin_p,
CODE_FOR_sqrtdf2, "__builtin_sh_media_FSQRT_D", SH_BLTIN_2, 0 },
{ shmedia_builtin_p,
CODE_FOR_sqrtsf2, "__builtin_sh_media_FSQRT_S", SH_BLTIN_2, 0 },
{ shmedia_builtin_p,
CODE_FOR_fsrra_s, "__builtin_sh_media_FSRRA_S", SH_BLTIN_2, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldhi_l, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldhi_q, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldlo_l, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldlo_q, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q, 0 },
{ shmedia_builtin_p,
CODE_FOR_sthi_l, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L, 0 },
{ shmedia_builtin_p,
CODE_FOR_sthi_q, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q, 0 },
{ shmedia_builtin_p,
CODE_FOR_stlo_l, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L, 0 },
{ shmedia_builtin_p,
CODE_FOR_stlo_q, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldhi_l64, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L64, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldhi_q64, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q64, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldlo_l64, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L64, 0 },
{ shmedia_builtin_p,
CODE_FOR_ldlo_q64, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q64, 0 },
{ shmedia_builtin_p,
CODE_FOR_sthi_l64, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L64, 0 },
{ shmedia_builtin_p,
CODE_FOR_sthi_q64, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q64, 0 },
{ shmedia_builtin_p,
CODE_FOR_stlo_l64, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L64, 0 },
{ shmedia_builtin_p,
CODE_FOR_stlo_q64, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q64, 0 },
{ shmedia_builtin_p,
CODE_FOR_nsb, "__builtin_sh_media_NSB", SH_BLTIN_SU, 0 },
{ shmedia_builtin_p,
CODE_FOR_byterev, "__builtin_sh_media_BYTEREV", SH_BLTIN_2, 0 },
{ shmedia_builtin_p,
CODE_FOR_prefetch, "__builtin_sh_media_PREFO", SH_BLTIN_PSSV, 0 },
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
};
static void
sh_init_builtins (void)
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{
tree shared[SH_BLTIN_NUM_SHARED_SIGNATURES];
memset (shared, 0, sizeof shared);
for (unsigned int di = 0; di < ARRAY_SIZE (bdesc); ++di)
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{
builtin_description* d = &bdesc[di];
if (!d->is_enabled ())
continue;
tree type, arg_type = NULL_TREE;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
int signature = d->signature;
if (signature < SH_BLTIN_NUM_SHARED_SIGNATURES && shared[signature])
type = shared[signature];
else
{
int has_result = signature_args[signature][0] != 0;
tree args[3];
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if ((signature_args[signature][1] & 8)
&& (((signature_args[signature][1] & 1) && TARGET_SHMEDIA32)
|| ((signature_args[signature][1] & 2) && TARGET_SHMEDIA64)))
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
continue;
if (! TARGET_FPU_ANY
&& FLOAT_MODE_P (insn_data[d->icode].operand[0].mode))
continue;
for (unsigned int i = 0; i < ARRAY_SIZE (args); i++)
args[i] = NULL_TREE;
for (int i = 3; ; i--)
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{
int arg = signature_args[signature][i];
int opno = i - 1 + has_result;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (arg & 8)
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
arg_type = ptr_type_node;
else if (arg)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
arg_type = (*lang_hooks.types.type_for_mode)
(insn_data[d->icode].operand[opno].mode, (arg & 1));
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
else if (i)
continue;
else
arg_type = void_type_node;
if (i == 0)
break;
args[i-1] = arg_type;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
}
type = build_function_type_list (arg_type, args[0], args[1],
args[2], NULL_TREE);
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
if (signature < SH_BLTIN_NUM_SHARED_SIGNATURES)
shared[signature] = type;
}
d->fndecl =
add_builtin_function (d->name, type, d - bdesc, BUILT_IN_MD,
NULL, NULL_TREE);
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
}
}
/* Implements target hook vector_mode_supported_p. */
bool
sh_vector_mode_supported_p (enum machine_mode mode)
{
if (TARGET_FPU_ANY
&& ((mode == V2SFmode)
|| (mode == V4SFmode)
|| (mode == V16SFmode)))
return true;
else if (TARGET_SHMEDIA
&& ((mode == V8QImode)
|| (mode == V2HImode)
|| (mode == V4HImode)
|| (mode == V2SImode)))
return true;
return false;
}
bool
sh_frame_pointer_required (void)
{
/* If needed override this in other tm.h files to cope with various OS
lossage requiring a frame pointer. */
if (SUBTARGET_FRAME_POINTER_REQUIRED)
return true;
if (crtl->profile)
return true;
return false;
}
/* Implements target hook dwarf_calling_convention. Return an enum
of dwarf_calling_convention. */
int
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
sh_dwarf_calling_convention (const_tree func)
{
if (sh_attr_renesas_p (func))
return DW_CC_GNU_renesas_sh;
return DW_CC_normal;
}
/* Returns the sh builtin decl for CODE. */
static tree
sh_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
{
if (code >= ARRAY_SIZE (bdesc))
return error_mark_node;
if (!bdesc[code].is_enabled ())
return error_mark_node;
return bdesc[code].fndecl;
}
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
/* Expand an expression EXP that calls a built-in function,
with result going to TARGET if that's convenient
(and in mode MODE if that's convenient).
SUBTARGET may be used as the target for computing one of EXP's operands.
IGNORE is nonzero if the value is to be ignored. */
static rtx
sh_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED, int ignore)
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
const struct builtin_description *d = &bdesc[fcode];
enum insn_code icode = d->icode;
int signature = d->signature;
int nop = 0;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
rtx op[4];
if (signature_args[signature][0])
{
if (ignore)
return NULL_RTX;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
enum machine_mode tmode = insn_data[icode].operand[0].mode;
if (! target || GET_MODE (target) != tmode
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
|| ! (*insn_data[icode].operand[0].predicate) (target, tmode))
target = gen_reg_rtx (tmode);
op[nop++] = target;
}
else
target = NULL_RTX;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
for (int i = 1; i <= 3; i++, nop++)
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
{
tree arg;
enum machine_mode opmode, argmode;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
tree optype;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
if (! signature_args[signature][i])
break;
tree.h (enum tree_code_class): Add tcc_vl_exp. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree.h (enum tree_code_class): Add tcc_vl_exp. (VL_EXP_CLASS_P): New. (TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (TREE_OPERAND_CHECK_CODE): Likewise. (GIMPLE_STMT_OPERAND_CHECK): Likewise. (TREE_RTL_OPERAND_CHECK): Likewise. (tree_operand_check_failed): Make second parameter the whole tree instead of its code. Fixed callers. (VL_EXP_CHECK): New. (TREE_OPERAND_LENGTH): New. (VL_EXP_OPERAND_LENGTH): New. (CALL_EXPR_FN): New. (CALL_EXPR_STATIC_CHAIN): New. (CALL_EXPR_ARGS): New. (CALL_EXPR_ARG): New. (call_expr_nargs): New. (CALL_EXPR_ARGP): New. (build_nt_call_list): Declare. (build_vl_exp_stat): Declare. (build_vl_exp): New. (build_call_list): Declare. (build_call_nary): Declare. (build_call_valist): Declare. (build_call_array): Declare. (call_expr_arg): Declare. (call_expr_argp): Declare. (call_expr_arglist): Declare. (fold_build_call_list): Declare. (fold_build_call_list_initializer): Declare. (fold_call_expr): Declare to replace fold_builtin. (fold_builtin_fputs): Update to agree with modified definition. (fold_builtin_strcpy): Likewise. (fold_builtin_strncpy): Likewise. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_next_arg): Likewise. (fold_build_call_expr): Declare. (fold_builtin_call_list): Declare. (fold_builtin_call_valist): Declare. (build_call_expr): Declare. (validate_arglist): Update to agree with modified definition. (tree_operand_length): New. (call_expr_arg_iterator): New. (init_call_expr_arg_iterator): New. (next_call_expr_arg): New. (first_call_expr_arg): New. (more_call_expr_args_p): New. (FOR_EACH_CALL_EXPR_ARG): New. * tree.c (tree_code_class_string): Add entries for tcc_vl_exp and tcc_gimple_stmt. (tree_code_size): Update documentation. Use sizeof (tree) rather than sizeof (char *). (tree_size): Likewise. Add case for tcc_vl_exp. (tree_node_structure): Add case for tcc_vl_exp. (contains_placeholder_p): Likewise. (substitute_in_expr): Likewise. (substitute_placeholder_in_expr): Likewise. (stabilize_reference_1): Likewise. (build3_stat): Remove logic for CALL_EXPRs. Replace with assertion to diagnose breakage of this interface for constructing CALL_EXPRs. (build_nt): Add similar assertion here. (build_nt_call_list): New. (simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors. (iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (get_callee_fndecl): Use new CALL_EXPR accessors. (tree_operand_check_failed): Change parameters to pass entire node instead of its code, so that we can call TREE_OPERAND_LENGTH on it. (process_call_operands): New. (build_vl_exp_stat): New. (build_call_list): New. (build_call_nary): New. (build_call_valist): New. (build_call_array): New. (walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (call_expr_arglist): New. * tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use tcc_vl_exp instead of a fixed-size tcc_expression. * doc/c-tree.texi (CALL_EXPR): Document new representation and accessors for CALL_EXPRs. (AGGR_INIT_EXPR): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * builtins.c (c_strlen): Return NULL_TREE instead of 0. (expand_builtin_nonlocal_goto): Change parameter to be entire CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors. (expand_builtin_prefetch): Likewise. (expand_builtin_classify_type): Likewise. (mathfn_built_in): Return NULL_TREE instead of 0. (expand_errno_check): Use new CALL_EXPR accessors. (expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_int_roundingfn): Likewise. (expand_builtin_int_roundingfn_2): Likewise. (expand_builtin_pow): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead of arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_RTX instead of 0. (expand_builtin_strstr): Likewise. (expand_builtin_strchr): Likewise. (expand_builtin_strrchr): Likewise. (expand_builtin_strpbrk): Likewise. (expand_builtin_memcpy): Likewise. (expand_builtin_mempcpy): Likewise. (expand_builtin_mempcpy_args): New. (expand_builtin_memmove): Similarly to expand_builtin_mempcpy. (expand_builtin_memmove_args): New. (expand_builtin_bcopy): Similarly to expand_builtin_mempcpy. (expand_movstr): Likewise. (expand_builtin_strcpy): Likewise. (expand_builtin_strcpy_args): New. (expand_builtin_stpcpy): Similarly to expand_builtin_strcpy. (expand_builtin_strncpy): Likewise. (expand_builtin_memset): Likewise. (expand_builtin_memset_args): New. (expand_builtin_bzero): Similarly to expand_builtin_memset. (expand_builtin_memcmp): Likewise. (expand_builtin_strcmp): Likewise. (expand_builtin_strncmp): Likewise. (expand_builtin_strcat): Likewise. (expand_builtin_strncat): Likewise. (expand_builtin_strspn): Likewise. (expand_builtin_strcspn): Likewise. (expand_builtin_args_info): Likewise. (expand_builtin_va_start): Likewise. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_end): Likewise. (expand_builtin_va_copy): Likewise. (expand_builtin_frame_address): Likewise. (expand_builtin_alloca): Likewise. (expand_builtin_bswap): Likewise. (expand_builtin_unop): Likewise. (expand_builtin_fputs): Likewise. (expand_builtin_expect): Likewise. (expand_builtin_fabs): Likewise. (expand_builtin_copysign): Likewise. (expand_builtin_printf): Likewise. (expand_builtin_fprintf): Likewise. (expand_builtin_sprintf): Likewise. (expand_builtin_init_trampoline): Likewise. (expand_builtin_signbit): Likewise. (expand_builtin_fork_or_exec): Likewise. (expand_builtin_sync_operation): Likewise. (expand_builtin_compare_and_swap): Likewise. (expand_builtin_lock_test_and_set): Likewise. (expand_builtin_lock_release): Likewise. (expand_builtin): Likewise. (builtin_mathfn_code): Likewise. (fold_builtin_constant_p): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_expect): Likewise. (fold_builtin_classify_type): Likewise. (fold_builtin_strlen): Likewise. (fold_builtin_nan): Likewise. (integer_valued_real_p): Likewise. (fold_trunc_transparent_mathfn): Likewise. (fold_fixed_mathfn): Likewise. (fold_builtin_cabs): Likewise. (fold_builtin_sqrt): Likewise. (fold_builtin_cbrt): Likewise. (fold_builtin_cos): Likewise. (fold_builtin_cosh): Likewise. (fold_builtin_tan): Likewise. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. (fold_builtin_trunc): Likewise. (fold_builtin_floor): Likewise. (fold_builtin_ceil): Likewise. (fold_builtin_round): Likewise. (fold_builtin_int_roundingfn): Likewise. (fold_builtin_bitop): Likewise. (fold_builtin_bswap): Likewise. (fold_builtin_logarithm): Likewise. (fold_builtin_hypot): Likewise. (fold_builtin_pow): Likewise. (fold_builtin_powi): Likewise. (fold_builtin_exponent): Likewise. (fold_builtin_memset): Likewise. (fold_builtin_bzero): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_bcopy): Deleted; call site changed to invoke fold_builtin_memory_op directly. (fold_builtin_strcpy): Similarly as for fold_builtin_memory_op. (fold_builtin_strncpy): Likewise. (fold_builtin_memcmp): Likewise. (fold_builtin_strcmp): Likewise. (fold_builtin_strncmp): Likewise. (fold_builtin_signbit): Likewise. (fold_builtin_copysign): Likewise. (fold_builtin_isascii): Likewise. (fold_builtin_toascii): Likewise. (fold_builtin_isdigit): Likewise. (fold_builtin_fabs): Likewise. (fold_builtin_abs): Likewise. (fold_builtin_fmin_fmax): Likewise. (fold_builtin_carg): Likewise. (fold_builtin_classify): Likewise. (fold_builtin_unordered_cmp): Likewise. (fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4): New functions split out from fold_builtin_1. (fold_builtin_n): New. (fold_builtin_varargs): New. (fold_builtin): Deleted. Most callers changed to use fold_call_expr instead. (fold_call_expr): New. (build_function_call_expr): Rewrite to use new helper function. (fold_builtin_call_list): New. (build_call_expr): New. (fold_builtin_call_valist): New. (rewrite_call_expr): New. (validate_arg): New. (validate_arglist): Change parameter to be entire CALL_EXPR instead of an arglist. Change return type to bool. Use new CALL_EXPR accessors. (fold_builtin_strstr): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (fold_builtin_strcat): Likewise. (fold_builtin_strncat): Likewise. (fold_builtin_strspn): Likewise. (fold_builtin_strcspn): Likewise. (fold_builtin_fputs): Likewise. (fold_builtin_next_arg): Likewise. (fold_builtin_sprintf): Likewise. (expand_builtin_object_size): Use new CALL_EXPR accessors. Use NULL_RTX instead of 0. (expand_builtin_memory_chk): Likewise. (maybe_emit_chk_warning): Likewise. (maybe_emit_sprintf_chk_warning): Likewise. (fold_builtin_object_size): Pass call arguments individually instead of as an arglist, fixing callers appropriately. Use new CALL_EXPR accessors and constructors. Return NULL_TREE instead of 0. (fold_builtin_memory_chk): Likewise. (fold_builtin_stxcpy_chk): Likewise. (fold_builtin_strncpy_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strcat_chk): Likewise. (fold_builtin_strncat_chk): Likewise. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_printf): Likewise. (fold_builtin_vprintf): Likewise. * fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and constructors. (operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case. (make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (extract_muldiv_1): Add VL_EXP_CLASS_P case. (fold_mathfn_compare): Use new CALL_EXPR accessors and constructors. (fold_unary): Likewise. (fold_binary): Likewise. (fold_ternary): Remove CALL_EXPR case, since they are no longer ternary expressions. (fold): Add logic for tcc_vl_exp. (fold_checksum_tree): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (fold_build3_stat): Add assertion to flag broken interface for constructing CALL_EXPRs. (fold_build_call_list): New. (fold_build_call_list_initializer): New. (tree_expr_nonnegative_p): Use new CALL_EXPR accessors and constructors. (fold_strip_sign_ops): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR accessors and dump arguments explicitly. * tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (dump_generic_node): Use new CALL_EXPR accessors and walk arguments explicitly. (print_call_name): Use new CALL_EXPR accessors. * print-tree.c (print_node): Add case tcc_vl_exp. Print CALL_EXPR arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors. (vrp_visit_stmt): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (force_move_till_expr): Likewise. * targhooks.c (default_external_stack_protect_fail): Use build_call_expr instead of build_function_call_expr. (default_hidden_stack_protect_fail): Likewise. * tree-complex.c (expand_complex_libcall): Use build_call_expr to build the call. * cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors and walk arguments explicitly. * tree-ssa-loop-niter.c (simplify_replace_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_simple_operations): Likewise. (infer_loop_bounds_from_array): Use new CALL_EXPR accessors. * gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs. * optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * value_prof.c (tree_ic): Use new CALL_EXPR accessors. (tree_ic_transform): Likewise. (interesting_stringop_to_profile_p): Pass entire CALL_EXPR as parameter instead of arglist. Fix callers. (tree_stringop_fixed_value): Use new CALL_EXPR accessors. (tree_stringops_transform): Likewise. (tree_indirect_call_to_profile): Likewise. (tree_stringops_values_to_profile): Likewise. * tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator. (eliminate_tail_call): Likewise. * ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (instantiate_parameters_1): Can't handle tcc_vl_exp here. * omp-low.c (build_omp_barrier): Use build_call_expr. (lower_rec_input_clauses): Likewise. (lower_reduction_clauses): Likewise. (expand_parallel_call): Likewise. (maybe_catch_exception): Likewise. (expand_omp_for_generic): Likewise. (expand_omp_for_static_nochunk): Likewise. (expand_omp_sections): Likewise. (lower_omp_single_simple): Likewise. (lower_omp_single_copy): Likewise. (lower_omp_master): Likewise. (lower_omp_ordered): Likewise. (lower_omp_critical): Likewise. * ipa-reference.c (check-call): Use new CALL_EXPR iterator. (scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR. * tree-gimple.c (is_gimple_call_addr): Fix doc. (recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. Add tcc_vl_exp case. * tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (chrec_contains_undetermined): Likewise. (tree_contains_chrecs): Likewise. (evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH. * cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors. * tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use fold_call_expr instead of fold_builtin. (ccp_fold_builtin): Likewise. Update calls into builtins.c to match declarations there. (fold_stmt): Use new CALL_EXPR constructor and accessors. Doc updates. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-pure-const.c (check_call): Use new CALL_EXPR accessors. (scan_function): Add case tcc_vl_exp for CALL_EXPR. * tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR accessors. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr. (execute_cse_sincos): Use new CALL_EXPR accessors. * tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator. * gimple-low.c (lower_function_body): Use build_call_expr. (lower_builtin_setjmp): Likewise. * expr.c (emit_block_move_via_libcall): Use build_call_expr. (set_storage_via_libcall): Likewise. (safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (expand_expr_real_1): Use new CALL_EXPR accessors. * tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and generalize to handle any number of operands. (TB_parent_eq): Likewise. * predict.c (expr_expected_value): Use new CALL_EXPR accessors. (strip_builtin_expect): Likewise. * function.c (gimplify_parameters): Use build_call_expr. * tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * ipa-type-escape.c (check_call): Use new CALL_EXPR iterators. (scan_for_refs): Add case tcc_vl_exp for CALL_EXPR. * tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR iterators. * gimplify.c (build_stack_save_restore): Use build_call_expr. (gimplify_decl_expr): Likewise. (gimplify_call_expr): Use fold_call_expr instead of fold_builtin. Use new CALL_EXPR iterators. (gimplify_modify_expr_to_memcpy): Use build_call_expr. (gimplify_modify_expr_to_memset): Likewise. (gimplify_variable_sized_compare): Likewise. (gimplify_omp_atomic_fetch_op): Likewise. (gimplify_omp_atomic_pipeline): Likewise. (gimplify_omp_atomic_mutex): Likewise. (gimplify_function_tree): Likewise. * calls.c (alloca_call_p): Use new CALL_EXPR accessors. (call_expr_flags): Likewise. (expand_call): Likewise. * except.c (expand_builtin_eh_return_data_regno): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. * coverage.c (create_coverage): Use build_call_expr. * tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete. (temp_call_expr_obstack): New. (pool_copy_list): Delete. (temp_copy_call_expr): New. (phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. Get rid of special goo for copying argument lists and use temp_copy_call_expr instead. (valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new CALL_EXPR accessors. (create_expression_by_pieces): Likewise. Use build_call_array to construct the result instead of fold_build3. (create_value_expr_from): Add tcc_vl_exp. Delete special goo for dealing with argument lists. (init_pre): Remove references to expression_node_pool and list_node_pool. Init temp_call_expr_obstack instead. (fini_pre): Remove references to expression_node_pool and list_node_pool. * tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors and walk arguments explicitly instead of as a list. * tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr. (mx_register_decls): Likewise. (mudflap_register_call): Likewise. (mudflap_finish_file): Likewise. * ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors. (ipa_callsite_compute_param): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR accessors and constructor. * tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR accessors and constructor. (convert_tramp_reference): Likewise. (convert_call_expr): Likewise. (finalize_nesting_tree_1): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR accessors. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr. * tree-inline.c (initialize_inlined_parameters): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors. (estimate_num_insns_1): Use new CALL_EXPR accessors. (expand_call_inline): Tidy up call to initialize_inlined_parameters. * tree-vect-transform.c (vect_create_epilog_for_reduction): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (vectorizable_reduction): Likewise. (vectorizable_call): Use new CALL_EXPR iterators. (vectorizable_conversion): Use build_call_expr. (vectorizable_operation): Use TREE_OPERAND_LENGTH. (vect_gen_widened_results_half): Use build_call_expr. (vect_setup_realignment): Likewise. (vectorizable_live_operation): Use TREE_OPERAND_LENGTH. * tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors. (pass_through_call): Likewise. (compute_object_sizes): Likewise. Use fold_call_expr instead of fold_builtin. * tree-profile.c (tree_gen_interval_profiler): Use build_call_expr. (tree_gen_pow2_profiler): Likewise. (tree_gen_one_value_profiler): Likewise. (tree_gen_ic_func_profiler): Likewise. (tree_gen_average_profiler): Likewise. (tree_gen_ior_profiler): Likewise. * tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp. (find_func_aliases): Use new CALL_EXPR accessors. Add case tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * convert.c (convert_to_real): Use new CALL_EXPR accessors and constructor. (convert_to_integer): Likewise. * tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR accessors. * config/frv/frv.c (frv_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_builtin): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr. (sparc_expand_builtin): Use new CALL_EXPR accessors. * config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise. (ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR accessors on it. Fix callers. (ix86_expand_store_builtin): Likewise. (ix86_expand_unop_builtin): Likewise. (ix86_expand_unop1_builtin): Likewise. (ix86_expand_sse_compare): Likewise. (ix86_expand_sse_comi): Likewise. (ix86_expand_vec_init_builtin): Likewise. (ix86_expand_vec_ext_builtin): Likewise. (ix86_expand_vec_set_builtin): Likewise. (ix86_expand_builtin): Use new CALL_EXPR accessors. * config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (iq2000_expand_builtin): Use new CALL_EXPR accessors. * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use build_call_expr. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. (rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_abs_builtin): Likewise. (rs6000_expand_binop_builtin): Likewise. (altivec_expand_predicate_builtin): Likewise. (altivec_expand_lv_builtin): Likewise. (spe_expand_stv_builtin): Likewise. (altivec_expand_stv_builtin): Likewise. (rs6000_expand_ternop_builtin): Likewise. (altivec_expand_ld_builtin): Use new CALL_EXPR accessors. (altivec_expand_st_builtin): Likewise. (altivec_expand_dst_builtin): Likewise. (altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (altivec_expand_vec_set_builtin): Likewise. (altivec_expand_vec_ext_builtin): Likewise. (altivec_expand_builtin): Use new CALL_EXPR accessors. (spe_expand_builtin): Likewise. (spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (spe_expand_evsel_builtin): Likewise. (rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and FCFSX cases must construct whole new CALL_EXPR, not just arglist. * config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (arm_expand_unop_builtin): Likewise. (arm_expand_builtin): Use new CALL_EXPR accessors. * config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR accessors. * config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR instead of arglist. Use new CALL_EXPR accessors. Fix callers. (bfin_expand_unop_builtin): Likewise. (bfin_expand_builtin): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * c-semantics.c (build_stmt): Add internal diagnostic check. * c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR accessors. Print arguments explicitly instead of as a list. * c-typeck.c (build_function_call): Use new CALL_EXPR constructors. * c-omp.c (c_finish_omp_barrier): Use build_call_expr. (c_finish_omp_flish): Likewise. * c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. (check_function_arguments_recurse): Use new CALL_EXPR accessors. (c_warn_unused_result): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation. Change class to tcc_vl_exp. * call.c (build_call): Use build_call_list instead of build3. (build_over_call): Likewise. (build_new_method_call): Use build_min_non_dep_call_list instead of build_min_non_dep. * error.c (dump_call_expr_args): New function. (dump_aggr_init_expr_args): New function. (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. * cvt.c (convert_to_void): Use build_call_array instead of build3; use new AGGR_INIT_EXPR accessor macros. * mangle.c (write_expression): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new AGGR_INIT_EXPR accessor macros. * cp-gimplify.c (cp_gimplify_init_expr): Use AGGR_INIT_EXPR_SLOT to set the slot operand. * cp-tree.h (AGGR_INIT_EXPR_FN): New macro. (AGGR_INIT_EXPR_SLOT): New macro. (AGGR_INIT_EXPR_ARG): New macro. (aggr_init_expr_nargs): New macro. (AGGR_INIT_EXPR_ARGP): New macro. (aggr_init_expr_arg_iterator): New. (init_aggr_init_expr_arg_iterator): New. (next_aggr_init_expr_arg): New. (first_aggr_init_expr_arg): New. (more_aggr_init_expr_args_p): New. (FOR_EACH_AGGR_INIT_EXPR_ARG): New. (stabilize_aggr_init): New declaration. (build_min_non_dep_call_list): Likewise. * tree.c (process_aggr_init_operands): New function. (build_aggr_init_array) New function. (build_cplus_new): Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros. Replace use of build3 with build_aggr_init_array. (build_min_non_dep_call_list) New function. (build_min_nt): Assert input code parameter is not a variable length expression class. (build_min, build_min_non_dep): Likewise. (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments to check for equality instead of recursing. Handle tcc_vl_exp tree code classes. (stabilize_call): Update to only handle CALL_EXPRs, not AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros. (stabilize_aggr_init): New function. (stabilize_init): Use it. * cxx-pretty-print.c (pp_cxx_postfix_expression) <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros and argument iterators. * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with build_vl_exp. Iterate through the operands, recursively processing each one. (tsubst_copy_and_build) <CALL_EXPR>: Update to use new CALL_EXPR accessor macros. (value_dependent_expression_p) <default>: Handle tcc_vl_exp tree code classes. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH. * semantics.c (finish_call_expr): Use build_nt_call_list instead of build_nt. (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR accessor macros. Use build_call_array to construct the CALL_EXPR node instead of build3 * decl2.c (build_offset_ref_call_from_tree): Use build_nt_call_list and build_min_non_dep_call_list instead of build_min_nt and build_min_non_dep. * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>: Use build_nt_call_list instead of build_min_nt. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead of build3. (BUILD_MONITOR_EXIT): Likewise. * java-gimplify.c (java_gimplify_component_ref): Use build_call_expr. (java_gimplify_modify_expr): Likewise. * class.c (cache_this_class_ref): Use build_call_expr. (build_static_field_ref): Likewise. (emit_indirect_register_classes): Likewise. (emit_register_classes): Likewise. * resource.c (write_resource_constructor): Use build_call_expr. * builtins.c (builtin_creator_function): Change interpretation of the second parameter to be the whole CALL_EXPR instead of the arglist. (max_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (min_builtin): Likewise. (abs_builtin): Likewise. (java_build_function_call_expr): Likewise. (convert_real): Likewise. (UNMARSHAL3): Likewise. (UNMARSHAL4): Likewise. (UNMARSHAL5): Likewise. (build_arglist_for_builtin): Delete. Fix callers to use build_call_expr instead. (putObject_builtin): Tweak parameter list. Use new CALL_EXPR accessors. (compareAndSwapInt_builtin): Likewise. (compareAndSwapLong_builtin): Likewise. (compareAndSwapObject_builtin): Likewise. (putVolatile_builtin): Likewise. (getVolatile_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. (check_for_builtin): Pass entire CALL_EXPR to builtin expander instead of arglist. * expr.c (build_java_athrow): Use build_call_nary instead of build3. (build_java_throw_out_of_bounds_exception): Likewise. (java_check_reference): Likewise. (build_java_arraystore_check): Likewise. (build_newarray): Likewise. (build_anewarray): Likewise. (expand_java_multinewarray): Use build_call_list instead of build3. (build_java_monitor): Use build_call_nary instead of build3. (java_create_object): Likewise. (expand_java_NEW): Likewise. (build_instanceof): Likewise. (expand_java_CHECKCAST): Likewise. (build_java_soft_divmod): Likewise. (build_java_binop): Likewise. (build_field_ref): Likewise. (build_class_init): Likewise. (rewrite_arglist_getcaller): Use build_call_expr. (build_invokeinterface): Use build_call_nary instead of build3. (expand_invoke): Use build_call_list instead of build3. (build_jni_stub): Use build_call_nary, build_call_list, or build_call_expr instead of build3. (expand_java_field_op): Use build_call_expr instead of build3. (force_evaluation_order): Use new CALL_EXPR accessors. * lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors. (objc_get_callee_fndecl): Likewise. 2007-02-15 Sandra Loosemore <sandra@codesourcery.com> Brooks Moses <brooks.moses@codesourcery.com> Lee Millward <lee.millward@codesourcery.com> * trans-expr.c (gfc_conv_power_op): Use build_call_expr. (gfc_conv_string_tmp): Likewise. (gfc_conv_concat_op): Likewise. (gfc_build_compare_string): Likewise. (gfc_conv_function_call): Use build_call_list instead of build3. * trans-array.c (gfc_trans_allocate_array_storage): Use build_call_expr. (gfc_grow_array): Likewise. (gfc_trans_array_ctor_element): Likewise. (gfc_trans_array_constructor_value): Likewise. (gfc_array_allocate): Likewise. (gfc_array_deallocate): Likewise. (gfc_trans_auto_array_allocation): Likewise. (gfc_trans_dummy_array_bias): Likewise. (gfc_conv_array_parameter): Likewise. (gfc_trans_dealloc_allocated): Likewise. (gfc_duplicate_allocatable): Likewise. * trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr. (gfc_trans_omp_flush): Likewise. * trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr. (gfc_trans_pause): Likewise. (gfc_trans_stop): Likewise. (gfc_trans_character_select): Likewise. (gfc_do_allocate): Likewise. (gfc_trans_assign_need_temp): Likewise. (gfc_trans_pointer_assign_need_temp): Likewise. (gfc_trans_forall_1): Likewise. (gfc_trans_where_2): Likewise. (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans.c (gfc_trans_runtime_check): Use build_call_expr. * trans-io.c (gfc_trans_open): Use build_call_expr. (gfc_trans_close): Likewise. (build_filepos): Likewise. (gfc_trans_inquire): Likewise. (NML_FIRST_ARG): Delete. (NML_ADD_ARG): Delete. (transfer_namelist_element): Use build_call_expr. (build_dt): Likewise. (gfc_trans_dt_end): Likewise. (transfer_expr): Likewise. (transfer_array-desc): Likewise. * trans-decl.c (gfc_generate_function_code): Use build_call_expr. (gfc_generate_constructors): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr. (gfc_conv_intrinsic_fdate): Likewise. (gfc_conv_intrinsic_ttynam): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_associated): Likewise. (gfc_conv_intrinsic_si_kind): Likewise. (gfc_conv_intrinsic_trim): Likewise. (gfc_conv_intrinsic_repeat: Likewise. (gfc_conv_intrinsic_iargc): Likewise. Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com> Co-Authored-By: Lee Millward <lee.millward@codesourcery.com> From-SVN: r122018
2007-02-16 00:50:49 +01:00
arg = CALL_EXPR_ARG (exp, i - 1);
if (arg == error_mark_node)
return const0_rtx;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (signature_args[signature][i] & 8)
{
opmode = ptr_mode;
optype = ptr_type_node;
}
else
{
opmode = insn_data[icode].operand[nop].mode;
optype = (*lang_hooks.types.type_for_mode) (opmode, 0);
}
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
argmode = TYPE_MODE (TREE_TYPE (arg));
if (argmode != opmode)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
arg = build1 (NOP_EXPR, optype, arg);
op[nop] = expand_expr (arg, NULL_RTX, opmode, EXPAND_NORMAL);
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
if (! (*insn_data[icode].operand[nop].predicate) (op[nop], opmode))
op[nop] = copy_to_mode_reg (opmode, op[nop]);
}
rtx pat = NULL_RTX;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
switch (nop)
{
case 1:
pat = (*insn_data[d->icode].genfun) (op[0]);
break;
case 2:
pat = (*insn_data[d->icode].genfun) (op[0], op[1]);
break;
case 3:
pat = (*insn_data[d->icode].genfun) (op[0], op[1], op[2]);
break;
case 4:
pat = (*insn_data[d->icode].genfun) (op[0], op[1], op[2], op[3]);
break;
default:
gcc_unreachable ();
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
}
if (! pat)
return NULL_RTX;
sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include. (sh_init_builtins, sh_media_init_builtins): New functions. (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. (builtin_description): New struct tag. (signature_args, bdesc): New arrays. (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. (print_operand): Add 'N' modifier. * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. (CONST_COSTS): Add special case for SHmedia AND. (PREDICATE_CODES): Add and_operand, arith_reg_dest, extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. target_operand can also be const or unspec. * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. (attribute type): Add new types. (anddi3): Add splitter. (movdi_const_16bit+1): Add code to handle vector constants and bitmasks efficiently. (shori_media): Have generator function made. (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. (ftrv): Likewise. (fpu_switch+1, fpu_switch+2): Remove constraint. From-SVN: r55147
2002-07-01 21:41:54 +02:00
emit_insn (pat);
return target;
}
sh-protos.h (binary_float_operator): Remove declaration. * sh-protos.h (binary_float_operator): Remove declaration. (sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare. * sh.c (print_operand, case 'N'): Check against CONST0_RTX. (unary_float_operator, sh_expand_unop_v2sf): New functions. (sh_expand_binop_v2sf): Likewise. (zero_vec_operand): Delete. (SH_BLTIN_UDI): New builtin shared signature define. Renumbered all non-shared ones. (bdesc): Change all the mextr builtins to use SH_BLTIN_UDI. Enable nsb and byterev. * sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS. (HARD_REGNO_MODE_OK): Allow TImode in fp regs. Allow V2SFmode in general regs. (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. Remove clause for immediate operands. (SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands. Add DF_HI_REGS. (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow lowpart fp regs - only for big endian for now. (LEGITIMATE_CONSTANT_P): Don't allow non-zero float vectors when FPU is in use. (EXTRA_CONTRAINT_U): Check against CONST0_RTX. (LOAD_EXTEND_OP): NIL for SImode. (REGISTER_MOVE_COST): Add DF_HI_REGS. Const for moves between general and fp registers is 4. PREDICATE_CODES: Amend binary_float_operator entry. Remove zero_vec_operand. Add unary_float_operator. * sh.md (udivsi3_i4_media): Use truncate instead of paradoxical subreg SET_DEST. (truncdisi2, truncdihi2, movv2sf): Allow memory destinations. (truncdiqi2): Do sign extension. (movsi_media, movdi_media): Allow to use r63 to an fp register. (movdf_media, movsf_media): Likewise. (movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS. Collapse to one define_insn_and_split. Allow immediate sources. (addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns. (movv4sf_i): Allow immediate sources. Use simplify_gen_subreg. (movv4sf): Allow immediate sources. (movsf_media_nofpu+1): Don't split moves to FP registers. (unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns. (movv8qi_i+3): Check against CONST0_RTX. (mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode for input and output operands. Fix argument 3 to gen_mextr_rl. (mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/ (msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise. (mshf0_w, fipr, ftrv): Likewise. (mshfhi_l_di): Now insn_and_split. Can handle FP regs. From-SVN: r55528
2002-07-17 17:15:04 +02:00
void
sh_expand_unop_v2sf (enum rtx_code code, rtx op0, rtx op1)
sh-protos.h (binary_float_operator): Remove declaration. * sh-protos.h (binary_float_operator): Remove declaration. (sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare. * sh.c (print_operand, case 'N'): Check against CONST0_RTX. (unary_float_operator, sh_expand_unop_v2sf): New functions. (sh_expand_binop_v2sf): Likewise. (zero_vec_operand): Delete. (SH_BLTIN_UDI): New builtin shared signature define. Renumbered all non-shared ones. (bdesc): Change all the mextr builtins to use SH_BLTIN_UDI. Enable nsb and byterev. * sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS. (HARD_REGNO_MODE_OK): Allow TImode in fp regs. Allow V2SFmode in general regs. (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. Remove clause for immediate operands. (SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands. Add DF_HI_REGS. (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow lowpart fp regs - only for big endian for now. (LEGITIMATE_CONSTANT_P): Don't allow non-zero float vectors when FPU is in use. (EXTRA_CONTRAINT_U): Check against CONST0_RTX. (LOAD_EXTEND_OP): NIL for SImode. (REGISTER_MOVE_COST): Add DF_HI_REGS. Const for moves between general and fp registers is 4. PREDICATE_CODES: Amend binary_float_operator entry. Remove zero_vec_operand. Add unary_float_operator. * sh.md (udivsi3_i4_media): Use truncate instead of paradoxical subreg SET_DEST. (truncdisi2, truncdihi2, movv2sf): Allow memory destinations. (truncdiqi2): Do sign extension. (movsi_media, movdi_media): Allow to use r63 to an fp register. (movdf_media, movsf_media): Likewise. (movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS. Collapse to one define_insn_and_split. Allow immediate sources. (addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns. (movv4sf_i): Allow immediate sources. Use simplify_gen_subreg. (movv4sf): Allow immediate sources. (movsf_media_nofpu+1): Don't split moves to FP registers. (unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns. (movv8qi_i+3): Check against CONST0_RTX. (mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode for input and output operands. Fix argument 3 to gen_mextr_rl. (mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/ (msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise. (mshf0_w, fipr, ftrv): Likewise. (mshfhi_l_di): Now insn_and_split. Can handle FP regs. From-SVN: r55528
2002-07-17 17:15:04 +02:00
{
rtx sel0 = const0_rtx;
rtx sel1 = const1_rtx;
rtx (*fn) (rtx, rtx, rtx, rtx, rtx) = gen_unary_sf_op;
sh-protos.h (binary_float_operator): Remove declaration. * sh-protos.h (binary_float_operator): Remove declaration. (sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare. * sh.c (print_operand, case 'N'): Check against CONST0_RTX. (unary_float_operator, sh_expand_unop_v2sf): New functions. (sh_expand_binop_v2sf): Likewise. (zero_vec_operand): Delete. (SH_BLTIN_UDI): New builtin shared signature define. Renumbered all non-shared ones. (bdesc): Change all the mextr builtins to use SH_BLTIN_UDI. Enable nsb and byterev. * sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS. (HARD_REGNO_MODE_OK): Allow TImode in fp regs. Allow V2SFmode in general regs. (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. Remove clause for immediate operands. (SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands. Add DF_HI_REGS. (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow lowpart fp regs - only for big endian for now. (LEGITIMATE_CONSTANT_P): Don't allow non-zero float vectors when FPU is in use. (EXTRA_CONTRAINT_U): Check against CONST0_RTX. (LOAD_EXTEND_OP): NIL for SImode. (REGISTER_MOVE_COST): Add DF_HI_REGS. Const for moves between general and fp registers is 4. PREDICATE_CODES: Amend binary_float_operator entry. Remove zero_vec_operand. Add unary_float_operator. * sh.md (udivsi3_i4_media): Use truncate instead of paradoxical subreg SET_DEST. (truncdisi2, truncdihi2, movv2sf): Allow memory destinations. (truncdiqi2): Do sign extension. (movsi_media, movdi_media): Allow to use r63 to an fp register. (movdf_media, movsf_media): Likewise. (movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS. Collapse to one define_insn_and_split. Allow immediate sources. (addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns. (movv4sf_i): Allow immediate sources. Use simplify_gen_subreg. (movv4sf): Allow immediate sources. (movsf_media_nofpu+1): Don't split moves to FP registers. (unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns. (movv8qi_i+3): Check against CONST0_RTX. (mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode for input and output operands. Fix argument 3 to gen_mextr_rl. (mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/ (msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise. (mshf0_w, fipr, ftrv): Likewise. (mshfhi_l_di): Now insn_and_split. Can handle FP regs. From-SVN: r55528
2002-07-17 17:15:04 +02:00
rtx op = gen_rtx_fmt_e (code, SFmode, op1);
emit_insn ((*fn) (op0, op1, op, sel0, sel0));
emit_insn ((*fn) (op0, op1, op, sel1, sel1));
}
void
sh_expand_binop_v2sf (enum rtx_code code, rtx op0, rtx op1, rtx op2)
sh-protos.h (binary_float_operator): Remove declaration. * sh-protos.h (binary_float_operator): Remove declaration. (sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare. * sh.c (print_operand, case 'N'): Check against CONST0_RTX. (unary_float_operator, sh_expand_unop_v2sf): New functions. (sh_expand_binop_v2sf): Likewise. (zero_vec_operand): Delete. (SH_BLTIN_UDI): New builtin shared signature define. Renumbered all non-shared ones. (bdesc): Change all the mextr builtins to use SH_BLTIN_UDI. Enable nsb and byterev. * sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS. (HARD_REGNO_MODE_OK): Allow TImode in fp regs. Allow V2SFmode in general regs. (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. Remove clause for immediate operands. (SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands. Add DF_HI_REGS. (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow lowpart fp regs - only for big endian for now. (LEGITIMATE_CONSTANT_P): Don't allow non-zero float vectors when FPU is in use. (EXTRA_CONTRAINT_U): Check against CONST0_RTX. (LOAD_EXTEND_OP): NIL for SImode. (REGISTER_MOVE_COST): Add DF_HI_REGS. Const for moves between general and fp registers is 4. PREDICATE_CODES: Amend binary_float_operator entry. Remove zero_vec_operand. Add unary_float_operator. * sh.md (udivsi3_i4_media): Use truncate instead of paradoxical subreg SET_DEST. (truncdisi2, truncdihi2, movv2sf): Allow memory destinations. (truncdiqi2): Do sign extension. (movsi_media, movdi_media): Allow to use r63 to an fp register. (movdf_media, movsf_media): Likewise. (movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS. Collapse to one define_insn_and_split. Allow immediate sources. (addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns. (movv4sf_i): Allow immediate sources. Use simplify_gen_subreg. (movv4sf): Allow immediate sources. (movsf_media_nofpu+1): Don't split moves to FP registers. (unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns. (movv8qi_i+3): Check against CONST0_RTX. (mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode for input and output operands. Fix argument 3 to gen_mextr_rl. (mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/ (msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise. (mshf0_w, fipr, ftrv): Likewise. (mshfhi_l_di): Now insn_and_split. Can handle FP regs. From-SVN: r55528
2002-07-17 17:15:04 +02:00
{
rtx op = gen_rtx_fmt_ee (code, SFmode, op1, op2);
emit_insn (gen_binary_sf_op0 (op0, op1, op2, op));
emit_insn (gen_binary_sf_op1 (op0, op1, op2, op));
sh-protos.h (binary_float_operator): Remove declaration. * sh-protos.h (binary_float_operator): Remove declaration. (sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare. * sh.c (print_operand, case 'N'): Check against CONST0_RTX. (unary_float_operator, sh_expand_unop_v2sf): New functions. (sh_expand_binop_v2sf): Likewise. (zero_vec_operand): Delete. (SH_BLTIN_UDI): New builtin shared signature define. Renumbered all non-shared ones. (bdesc): Change all the mextr builtins to use SH_BLTIN_UDI. Enable nsb and byterev. * sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS. (HARD_REGNO_MODE_OK): Allow TImode in fp regs. Allow V2SFmode in general regs. (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. Remove clause for immediate operands. (SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands. Add DF_HI_REGS. (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow lowpart fp regs - only for big endian for now. (LEGITIMATE_CONSTANT_P): Don't allow non-zero float vectors when FPU is in use. (EXTRA_CONTRAINT_U): Check against CONST0_RTX. (LOAD_EXTEND_OP): NIL for SImode. (REGISTER_MOVE_COST): Add DF_HI_REGS. Const for moves between general and fp registers is 4. PREDICATE_CODES: Amend binary_float_operator entry. Remove zero_vec_operand. Add unary_float_operator. * sh.md (udivsi3_i4_media): Use truncate instead of paradoxical subreg SET_DEST. (truncdisi2, truncdihi2, movv2sf): Allow memory destinations. (truncdiqi2): Do sign extension. (movsi_media, movdi_media): Allow to use r63 to an fp register. (movdf_media, movsf_media): Likewise. (movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS. Collapse to one define_insn_and_split. Allow immediate sources. (addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns. (movv4sf_i): Allow immediate sources. Use simplify_gen_subreg. (movv4sf): Allow immediate sources. (movsf_media_nofpu+1): Don't split moves to FP registers. (unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns. (movv8qi_i+3): Check against CONST0_RTX. (mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode for input and output operands. Fix argument 3 to gen_mextr_rl. (mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/ (msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise. (mshf0_w, fipr, ftrv): Likewise. (mshfhi_l_di): Now insn_and_split. Can handle FP regs. From-SVN: r55528
2002-07-17 17:15:04 +02:00
}
/* Return true if hard register REGNO can hold a value of machine-mode MODE.
We can allow any mode in any general register. The special registers
only allow SImode. Don't allow any mode in the PR.
We cannot hold DCmode values in the XD registers because alter_reg
handles subregs of them incorrectly. We could work around this by
spacing the XD registers like the DR registers, but this would require
additional memory in every compilation to hold larger register vectors.
We could hold SFmode / SCmode values in XD registers, but that
would require a tertiary reload when reloading from / to memory,
and a secondary reload to reload from / to general regs; that
LANGUAGES: Fix typos. * LANGUAGES: Fix typos. * Makefile.in: Fix typos. * alias.c: Fix typos. * auto-inc-dec.c: Fix typos. * bb-reorder.c: Fix typos. * cfgcleanup.c: Fix typos. * cgraph.c: Fix typos. * cgraph.h: Fix typos. * cgraphunit.c: Fix typos. * collect2-aix.h: Fix typos. * collect2.c: Fix typos. * compare-elim.c: Fix typos. * config/alpha/vms.h: Fix typos. * config/arm/README-interworking: Fix typos. * config/arm/arm.c: Fix typos. * config/arm/iterators.md: Fix typos. * config/arm/vxworks.h: Fix typos. * config/avr/avr.c: Fix typos. * config/avr/avr.h: Fix typos. * config/avr/avr.md: Fix typos. * config/avr/builtins.def: Fix typos. * config/c6x/c6x.c: Fix typos. * config/cr16/cr16.c: Fix typos. * config/cr16/cr16.md: Fix typos. * config/cris/cris.md: Fix typos. * config/darwin.c: Fix typos. * config/darwin.opt: Fix typos. * config/i386/i386-c.c: Fix typos. * config/i386/i386.c: Fix typos. * config/ia64/ia64.c: Fix typos. * config/m68k/cf.md: Fix typos. * config/mep/mep.c: Fix typos. * config/microblaze/microblaze.c: Fix typos. * config/microblaze/microblaze.h: Fix typos. * config/mn10300/mn10300.c: Fix typos. * config/mn10300/mn10300.md: Fix typos. * config/pa/pa.c: Fix typos. * config/picochip/picochip.h: Fix typos. * config/rs6000/a2.md: Fix typos. * config/rs6000/rs6000.c: Fix typos. * config/rs6000/vector.md: Fix typos. * config/rx/rx.md: Fix typos. * config/rx/rx.opt: Fix typos. * config/s390/2097.md: Fix typos. * config/s390/s390.c: Fix typos. * config/s390/s390.h: Fix typos. * config/sh/sh.c: Fix typos. * config/sh/sh.md: Fix typos. * config/sparc/sync.md: Fix typos. * config/spu/spu.c: Fix typos. * config/spu/spu.md: Fix typos. * config/vms/vms.c: Fix typos. * config/vxworks-dummy.h: Fix typos. * config/vxworks.h: Fix typos. * cselib.c: Fix typos. * df-scan.c: Fix typos. * df.h: Fix typos. * doc/extend.texi: Fix typos. * doc/install.texi: Fix typos. * doc/invoke.texi: Fix typos. * doc/md.texi: Fix typos. * doc/plugins.texi: Fix typos. * doc/rtl.texi: Fix typos. * dse.c: Fix typos. * dwarf2asm.c: Fix typos. * dwarf2out.c: Fix typos. * except.h: Fix typos. * expr.c: Fix typos. * fold-const.c: Fix typos. * gcc.c: Fix typos. * gcse.c: Fix typos. * genautomata.c: Fix typos. * gengtype-state.c: Fix typos. * gengtype.c: Fix typos. * genhooks.c: Fix typos. * gimple-fold.c: Fix typos. * gimple-pretty-print.c: Fix typos. * gimple.c: Fix typos. * gimple.h: Fix typos. * gimplify.c: Fix typos. * graphite-interchange.c: Fix typos. * graphite-sese-to-poly.c: Fix typos. * ifcvt.c: Fix typos. * input.c: Fix typos. * ipa-cp.c: Fix typos. * ipa-inline-analysis.c: Fix typos. * ipa-inline-transform.c: Fix typos. * ipa-inline.c: Fix typos. * ipa-pure-const.c: Fix typos. * ipa-ref.h: Fix typos. * ipa-reference.c: Fix typos. * ipa-utils.c: Fix typos. * ipa.c: Fix typos. * ira-emit.c: Fix typos. * ira-lives.c: Fix typos. * lto-streamer.c: Fix typos. * lto-streamer.h: Fix typos. * lto-wrapper.c: Fix typos. * mcf.c: Fix typos. * mode-switching.c: Fix typos. * modulo-sched.c: Fix typos. * plugin.c: Fix typos. * postreload.c: Fix typos. * sched-deps.c: Fix typos. * sel-sched-ir.c: Fix typos. * sel-sched-ir.h: Fix typos. * sel-sched.c: Fix typos. * sese.c: Fix typos. * stor-layout.c: Fix typos. * target-hooks-macros.h: Fix typos. * target.def: Fix typos. * trans-mem.c: Fix typos. * tree-eh.c: Fix typos. * tree-predcom.c: Fix typos. * tree-sra.c: Fix typos. * tree-ssa-address.c: Fix typos. * tree-ssa-loop-ivopts.c: Fix typos. * tree-ssa-loop-niter.c: Fix typos. * tree-ssa-math-opts.c: Fix typos. * tree-ssa-pre.c: Fix typos. * tree-ssa-propagate.c: Fix typos. * tree-ssa-reassoc.c: Fix typos. * tree-ssa-sccvn.c: Fix typos. * tree-ssa-ter.c: Fix typos. * tree-ssa-uninit.c: Fix typos. * tree-ssanames.c: Fix typos. * tree-vect-generic.c: Fix typos. * tree-vect-slp.c: Fix typos. * tree.c: Fix typos. * tree.h: Fix typos. * varasm.c: Fix typos. * varpool.c: Fix typos. From-SVN: r187959
2012-05-29 16:14:06 +02:00
seems to be a losing proposition.
We want to allow TImode FP regs so that when V4SFmode is loaded as TImode,
it won't be ferried through GP registers first. */
bool
sh_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
{
if (SPECIAL_REGISTER_P (regno))
return mode == SImode;
if (regno == FPUL_REG)
return (mode == SImode || mode == SFmode);
if (FP_REGISTER_P (regno) && mode == SFmode)
return true;
if (mode == V2SFmode)
{
if (((FP_REGISTER_P (regno) && (regno - FIRST_FP_REG) % 2 == 0)
|| GENERAL_REGISTER_P (regno)))
return true;
else
return false;
}
if (mode == V4SFmode)
{
if ((FP_REGISTER_P (regno) && (regno - FIRST_FP_REG) % 4 == 0)
|| GENERAL_REGISTER_P (regno))
return true;
else
return false;
}
if (mode == V16SFmode)
{
if (TARGET_SHMEDIA)
{
if (FP_REGISTER_P (regno) && (regno - FIRST_FP_REG) % 16 == 0)
return true;
else
return false;
}
else
return regno == FIRST_XD_REG;
}
if (FP_REGISTER_P (regno))
{
if (mode == SFmode
|| mode == SImode
|| ((TARGET_SH2E || TARGET_SHMEDIA) && mode == SCmode)
|| ((((TARGET_SH4 || TARGET_SH2A_DOUBLE) && mode == DFmode)
|| mode == DCmode
|| (TARGET_SHMEDIA
&& (mode == DFmode || mode == DImode
|| mode == V2SFmode || mode == TImode)))
&& ((regno - FIRST_FP_REG) & 1) == 0)
|| ((TARGET_SH4 || TARGET_SHMEDIA) && mode == TImode
&& ((regno - FIRST_FP_REG) & 3) == 0))
return true;
else
return false;
}
if (XD_REGISTER_P (regno))
return mode == DFmode;
if (TARGET_REGISTER_P (regno))
return (mode == DImode || mode == SImode || mode == PDImode);
if (regno == PR_REG)
return mode == SImode;
if (regno == FPSCR_REG)
return mode == PSImode;
/* FIXME. This works around PR target/37633 for -O0. */
if (!optimize && TARGET_SHMEDIA32 && GET_MODE_SIZE (mode) > 4)
{
unsigned int n = GET_MODE_SIZE (mode) / 8;
if (regno >= FIRST_GENERAL_REG + 10 - n + 1
&& regno <= FIRST_GENERAL_REG + 14)
return false;
}
return true;
}
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
/* Return the class of registers for which a mode change from FROM to TO
is invalid. */
bool
sh_cannot_change_mode_class (enum machine_mode from, enum machine_mode to,
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
enum reg_class rclass)
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
{
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
/* We want to enable the use of SUBREGs as a means to
VEC_SELECT a single element of a vector. */
/* This effectively disallows using GENERAL_REGS for SFmode vector subregs.
This can be problematic when SFmode vector subregs need to be accessed
on the stack with displacement addressing, as it happens with -O0.
Thus we disallow the mode change for -O0. */
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
if (to == SFmode && VECTOR_MODE_P (from) && GET_MODE_INNER (from) == SFmode)
return optimize ? (reg_classes_intersect_p (GENERAL_REGS, rclass)) : false;
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
if (GET_MODE_SIZE (from) != GET_MODE_SIZE (to))
{
if (TARGET_LITTLE_ENDIAN)
{
if (GET_MODE_SIZE (to) < 8 || GET_MODE_SIZE (from) < 8)
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 reg_classes_intersect_p (DF_REGS, rclass);
}
else
{
if (GET_MODE_SIZE (from) < 8)
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 reg_classes_intersect_p (DF_HI_REGS, rclass);
}
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
}
return false;
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
}
tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. * doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation, based on the above, for new target hook. * hooks.c (hook_bool_mode_true): New generic hook. * hooks.h (hook_bool_mode_true): Add prototype. * target.h (struct gcc_target): Add small_register_classes_for_mode_p target hook. * target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default target hook, set to hook_bool_mode_false. * regs.h: Remove default definition of SMALL_REGISTER_CLASSES. * reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES with targetm.small_register_classes_for_mode_p. (find_reusable_reload): Likewise. (combine_reloads): Likewise. * reload1.c (reload_as_needed): Likewise. * cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise. * ifcvt.c (noce_process_if_block, check_cond_move_block, dead_or_predicable): Likewise. * regmove.c (optimize_reg_copy_1): Likewise. * calls.c (prepare_call_address): Likewise. (precompute_register_parameters): Likewise. * config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/sh/sh.c (sh_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small except for SH64. (sh_override_options): Use the new hook. * config/sh/sh-protos.h (sh_small_register_classes_for_mode_p): Add prototype. * config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/arm/arm.c (arm_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for THUMB1. * config/arm/arm-protos.h (arm_small_register_classes_for_mode_p): Add prototype. * config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/mips/mips.c (mips_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for MIPS16. * config/mips/mips-protos.h (mips_small_register_classes_for_mode_p): Add prototype. * config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/m32c/m32c.h: Likewise. * config/pdp11/pdp11.h: Likewise. * config/avr/avr.h: Likewise. * config/xtensa/xtensa.h: Likewise. * config/m68hc11/m68hc11.h: Likewise. * config/mn10300/mn10300.h: Likewise. * config/mcore/mcore.h: Likewise. * config/h8300/h8300.h: Likewise. * config/bfin/bfin.h: Likewise. * config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition. * config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition. From-SVN: r158997
2010-05-03 19:47:47 +02:00
/* Return true if registers in machine mode MODE will likely be
allocated to registers in small register classes. */
bool
tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. * doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation, based on the above, for new target hook. * hooks.c (hook_bool_mode_true): New generic hook. * hooks.h (hook_bool_mode_true): Add prototype. * target.h (struct gcc_target): Add small_register_classes_for_mode_p target hook. * target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default target hook, set to hook_bool_mode_false. * regs.h: Remove default definition of SMALL_REGISTER_CLASSES. * reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES with targetm.small_register_classes_for_mode_p. (find_reusable_reload): Likewise. (combine_reloads): Likewise. * reload1.c (reload_as_needed): Likewise. * cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise. * ifcvt.c (noce_process_if_block, check_cond_move_block, dead_or_predicable): Likewise. * regmove.c (optimize_reg_copy_1): Likewise. * calls.c (prepare_call_address): Likewise. (precompute_register_parameters): Likewise. * config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/sh/sh.c (sh_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small except for SH64. (sh_override_options): Use the new hook. * config/sh/sh-protos.h (sh_small_register_classes_for_mode_p): Add prototype. * config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/arm/arm.c (arm_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for THUMB1. * config/arm/arm-protos.h (arm_small_register_classes_for_mode_p): Add prototype. * config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/mips/mips.c (mips_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for MIPS16. * config/mips/mips-protos.h (mips_small_register_classes_for_mode_p): Add prototype. * config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/m32c/m32c.h: Likewise. * config/pdp11/pdp11.h: Likewise. * config/avr/avr.h: Likewise. * config/xtensa/xtensa.h: Likewise. * config/m68hc11/m68hc11.h: Likewise. * config/mn10300/mn10300.h: Likewise. * config/mcore/mcore.h: Likewise. * config/h8300/h8300.h: Likewise. * config/bfin/bfin.h: Likewise. * config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition. * config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition. From-SVN: r158997
2010-05-03 19:47:47 +02:00
sh_small_register_classes_for_mode_p (enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (! TARGET_SHMEDIA);
}
/* If ADDRESS refers to a CODE_LABEL, add NUSES to the number of times
that label is used. */
void
sh_mark_label (rtx address, int nuses)
{
if (GOTOFF_P (address))
{
/* Extract the label or symbol. */
address = XEXP (address, 0);
if (GET_CODE (address) == PLUS)
address = XEXP (address, 0);
address = XVECEXP (address, 0, 0);
}
if (GET_CODE (address) == LABEL_REF
&& LABEL_P (XEXP (address, 0)))
LABEL_NUSES (XEXP (address, 0)) += nuses;
}
/* Compute extra cost of moving data between one register class
and another. */
/* If SECONDARY*_RELOAD_CLASS says something about the src/dst pair, regclass
uses this information. Hence, the general register <-> floating point
register information here is not used for SFmode. */
static int
sh_register_move_cost (enum machine_mode mode,
reg_class_t srcclass, reg_class_t dstclass)
{
if (dstclass == T_REGS || dstclass == PR_REGS)
return 10;
if (dstclass == MAC_REGS && srcclass == MAC_REGS)
return 4;
if (mode == SImode && ! TARGET_SHMEDIA && TARGET_FMOVD
&& REGCLASS_HAS_FP_REG (srcclass)
&& REGCLASS_HAS_FP_REG (dstclass))
return 4;
if (REGCLASS_HAS_FP_REG (dstclass) && srcclass == T_REGS)
return ((TARGET_HARD_SH4 && !optimize_size) ? 10 : 7);
if ((REGCLASS_HAS_FP_REG (dstclass) && srcclass == MAC_REGS)
|| (dstclass == MAC_REGS && REGCLASS_HAS_FP_REG (srcclass)))
return 9;
if ((REGCLASS_HAS_FP_REG (dstclass)
&& REGCLASS_HAS_GENERAL_REG (srcclass))
|| (REGCLASS_HAS_GENERAL_REG (dstclass)
&& REGCLASS_HAS_FP_REG (srcclass)))
{
/* Discourage trying to use fp regs for a pointer. This also
discourages fp regs with SImode because Pmode is an alias
of SImode on this target. See PR target/48596. */
int addend = (mode == Pmode) ? 40 : 0;
return (((TARGET_SHMEDIA ? 4 : TARGET_FMOVD ? 8 : 12) + addend)
* ((GET_MODE_SIZE (mode) + 7) / 8U));
}
if ((dstclass == FPUL_REGS
&& REGCLASS_HAS_GENERAL_REG (srcclass))
|| (srcclass == FPUL_REGS
&& REGCLASS_HAS_GENERAL_REG (dstclass)))
return 5;
if ((dstclass == FPUL_REGS
&& (srcclass == PR_REGS || srcclass == MAC_REGS || srcclass == T_REGS))
|| (srcclass == FPUL_REGS
&& (dstclass == PR_REGS || dstclass == MAC_REGS)))
return 7;
if ((srcclass == TARGET_REGS && ! REGCLASS_HAS_GENERAL_REG (dstclass))
|| ((dstclass) == TARGET_REGS && ! REGCLASS_HAS_GENERAL_REG (srcclass)))
return 20;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* ??? ptabs faults on (value & 0x3) == 0x3 */
if (TARGET_SHMEDIA
&& ((srcclass) == TARGET_REGS || (srcclass) == SIBCALL_REGS))
{
if (sh_gettrcost >= 0)
return sh_gettrcost;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
else if (!TARGET_PT_FIXED)
return 100;
}
if ((srcclass == FPSCR_REGS && ! REGCLASS_HAS_GENERAL_REG (dstclass))
|| (dstclass == FPSCR_REGS && ! REGCLASS_HAS_GENERAL_REG (srcclass)))
return 4;
if (TARGET_SHMEDIA
|| (TARGET_FMOVD
&& ! REGCLASS_HAS_GENERAL_REG (srcclass)
&& ! REGCLASS_HAS_GENERAL_REG (dstclass)))
return 2 * ((GET_MODE_SIZE (mode) + 7) / 8U);
return 2 * ((GET_MODE_SIZE (mode) + 3) / 4U);
}
static rtx emit_load_ptr (rtx, rtx);
static rtx
emit_load_ptr (rtx reg, rtx addr)
{
rtx mem = gen_const_mem (ptr_mode, addr);
if (Pmode != ptr_mode)
mem = gen_rtx_SIGN_EXTEND (Pmode, mem);
return emit_move_insn (reg, mem);
}
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
static void
sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
CUMULATIVE_ARGS cum;
int structure_value_byref = 0;
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, this_value, sibcall, insns, funexp;
tree funtype = TREE_TYPE (function);
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
int simple_add = CONST_OK_FOR_ADD (delta);
int did_load = 0;
rtx scratch0, scratch1, scratch2;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
unsigned i;
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;
output.h: (current_function_is_leaf... * output.h: (current_function_is_leaf, current_function_sp_is_unchanging, current_function_uses_only_leaf_regs): Remove. * function.c (current_function_is_leaf, current_function_sp_is_unchanging, current_function_uses_only_leaf_regs): Remove. (rest_of_handle_check_leaf_regs): Set crtl->uses_only_leaf_regs instead of current_function_uses_only_leaf_regs. * function.h (struct rtl_data): New fields sp_is_unchanging, is_leaf, uses_only_leaf_regs. * resource.c (init_resource_info): Replace current_function_is_leaf, current_function_sp_is_unchanging, and current_function_uses_only_leaf_regs with new crtl fields. * sdbout.c (sdbout_symbol): Likewise. * df-core.c (rest_of_handle_df_initialize): Likewise. * ira.c (ira): Likewise. * final.c (final_start_function): Likewise. * reorg.c (fill_simple_delay_slots): Likewise. * regrename.c (check_new_reg_p): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. (notice_stack_pointer_modification): Likewise. * dbxout.c (dbxout_symbol): Likewise. (dbxout_parms): Likewise. * sel-sched.c (init_regs_for_mode): Likewise. * dwarf2out.c (dbx_reg_number): Likewise. (multiple_reg_loc_descriptor): Likewise. * config/i386/i386.c (ix86_frame_pointer_required): Likewise. (gen_pop): Likewise. (ix86_select_alt_pic_regnum): Likewise. (ix86_compute_frame_layout): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (ix86_expand_epilogue): Likewise. * config/rs6000/rs6000.c (rs6000_stack_info): Likewise. * config/h8300/h8300.c (byte_reg): Likewise. * config/c6x/c6x.c (must_reload_pic_reg_p): Likewise. (c6x_save_reg): Likewise. (c6x_compute_frame_layout): Likewise. * config/pa/pa.c (pa_compute_frame_size): Likewise. (pa_output_function_prologue): Likewise. * config/stormy16/stormy16.c (struct xstormy16_stack_layout): Likewise. * config/sparc/sparc.md (attr "leaf_function"): Likewise. * config/sparc/sparc.c (sparc_initial_elimination_offset): Likewise. (sparc_expand_prologue): Likewise. (sparc_flat_expand_prologue): Likewise. (sparc_asm_function_prologue): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_frame_pointer_required): Likewise. * config/epiphany/epiphany.c (epiphany_compute_function_type): Likewise. (epiphany_compute_frame_size): Likewise. * config/lm32/lm32.c (lm32_compute_frame_size): Likewise. * config/cris/cris.c (cris_md_asm_clobbers): Likewise. (cris_frame_pointer_required): Likewise. * config/tilepro/tilepro.c (emit_sp_adjust): Likewise. (tilepro_current_function_is_leaf): Likewise. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/ia64/ia64.c (find_gr_spill): Likewise. (ia64_compute_frame_size): Likewise. (ia64_can_eliminate): Likewise. (ia64_initial_elimination_offset): Likewise. * config/m68k/m68k.c (m68k_save_reg): Likewise. (m68k_expand_epilogue): Likewise. * config/rx/rx.c (rx_get_stack_layout): Likewise. * config/tilegx/tilegx.c (tilegx_current_function_is_leaf): Likewise. * config/picochip/picochip.c (picochip_can_eliminate_link_sp_save): Likewise. (picochip_output_frame_debug): Likewise. * config/sh/sh.c (sh_media_register_for_return): Likewise. (sh_allocate_initial_value): Likewise. (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_must_save_register): Likewise. (compute_frame_size): Likewise. (microblaze_initial_elimination_offset): Likewise. (microblaze_expand_prologue): Likewise. (microblaze_expand_epilogue): Likewise. * config/frv/frv.c (frv_expand_epilogue): Likewise. (frv_frame_pointer_required): Likewise. * config/spu/spu.c (get_pic_reg): Likewise. (direct_return): Likewise. (spu_expand_prologue): Likewise. (spu_expand_epilogue): Likewise. (spu_initial_elimination_offset): Likewise. * config/mips/mips.c (mips_global_pointer): Likewise. (mips_cfun_might_clobber_call_saved_reg_p): Likewise. (mips_compute_frame_info): Likewise. * config/mep/mep.c (mep_interrupt_saved_reg): Likewise. (mep_reload_pointer): Likewise. * config/rl78/rl78.c (need_to_save): Likewise. * config/cr16/cr16.c (cr16_compute_save_regs): Likewise. * config/score/score.c (score_compute_frame_size): Likewise. (score_function_prologue): Likewise. * config/bfin/bfin.c (must_save_p): Likewise. (expand_prologue_reg_save): Likewise. (expand_epilogue_reg_restore): Likewise. (bfin_frame_pointer_required): Likewise. (n_regs_saved_by_prologue): Likewise. (add_to_reg): Likewise. (expand_interrupt_handler_prologue): Likewise. (expand_interrupt_handler_epilogue): Likewise. (bfin_expand_prologue): Likewise. * config/avr/avr.c (avr_regs_to_save): Likewise. (avr_prologue_setup_frame): Likewise. (expand_epilogue): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. (s390_register_info): Likewise. (s390_frame_info): Likewise. (s390_init_frame_layout): Likewise. (s390_emit_prologue): Likewise. From-SVN: r188918
2012-06-24 19:58:46 +02:00
crtl->uses_only_leaf_regs = 1;
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);
/* Find the "this" pointer. We have such a wide range of ABIs for the
SH that it's best to do this completely machine independently.
"this" is passed as first argument, unless a structure return pointer
comes first, in which case "this" comes second. */
tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS. (emit_library_call_value_1): Likewise pass nargs. * expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here. * function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS. * config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args parameter instead of scanning TYPE_ARGS_TYPES to count args. * config/rs6000/rs6000-protos.h (init_cumulative_args): Update prototype. * config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg. (INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000. (INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0. * config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to INIT_CUMULATIVE_ARGS. * config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update. * config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h, config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h, config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h, config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h, config/pa/pa.h, config/pdp11/pdp11.h config/s390/s390.h, config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise. From-SVN: r77380
2004-02-06 07:18:36 +01:00
INIT_CUMULATIVE_ARGS (cum, funtype, NULL_RTX, 0, 1);
#ifndef PCC_STATIC_STRUCT_RETURN
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
structure_value_byref = 1;
#endif /* not PCC_STATIC_STRUCT_RETURN */
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
if (structure_value_byref && sh_struct_value_rtx (function, 0) == 0)
{
tree ptype = build_pointer_type (TREE_TYPE (funtype));
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
sh_function_arg_advance (pack_cumulative_args (&cum), Pmode, ptype, true);
}
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
this_rtx
= sh_function_arg (pack_cumulative_args (&cum), Pmode, ptr_type_node, true);
/* For SHcompact, we only have r0 for a scratch register: r1 is the
static chain pointer (even if you can't have nested virtual functions
right now, someone might implement them sometime), and the rest of the
registers are used for argument passing, are callee-saved, or reserved. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* We need to check call_used_regs / fixed_regs in case -fcall_saved-reg /
-ffixed-reg has been used. */
if (! call_used_regs[0] || fixed_regs[0])
error ("r0 needs to be available as a call-clobbered register");
scratch0 = scratch1 = scratch2 = gen_rtx_REG (Pmode, 0);
if (! TARGET_SH5)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (call_used_regs[1] && ! fixed_regs[1])
scratch1 = gen_rtx_REG (ptr_mode, 1);
/* N.B., if not TARGET_HITACHI, register 2 is used to pass the pointer
pointing where to return struct values. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (call_used_regs[3] && ! fixed_regs[3])
scratch2 = gen_rtx_REG (Pmode, 3);
}
else if (TARGET_SHMEDIA)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
for (i = FIRST_GENERAL_REG; i <= LAST_GENERAL_REG; i++)
if (i != REGNO (scratch0) &&
call_used_regs[i] && ! fixed_regs[i] && ! FUNCTION_ARG_REGNO_P (i))
{
scratch1 = gen_rtx_REG (ptr_mode, i);
break;
}
if (scratch1 == scratch0)
cfgloop.c (verify_loop_structure): Use %' in diagnostics. * cfgloop.c (verify_loop_structure): Use %' in diagnostics. Start diagnostics with lowercase letters. * cgraphunit.c (verify_cgraph_node): Start diagnostics with lowercase letters. * collect2.c (maybe_run_lto_and_relink): Remove trailing '.' from diagnostic. * config/alpha/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/arm/arm.c (arm_get_pcs_model): Start diagnostics with lowercase letters. * config/arm/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. Remove trailing ' ' from diagnostic. * config/avr/avr.c (print_operand_address): Start diagnostic with a lowercase letter and remove trailing '.'. * config/avr/avr.opt (mpmem-wrap-around): Fix typo in help text. * config/bfin/bfin.c (bfin_option_override): Start diagnostics with lowercase letters. Use %' in diagnostics. Remove trailing '.' from diagnostics. (bfin_handle_longcall_attribute): Use %' in diagnostic. * config/cris/cris.c (cris_split_movdx, cris_expand_pic_call_address): Start diagnostics with lowercase letters. (cris_asm_output_label_ref): Use %' in diagnostic. * config/cris/cris.h (ASM_SPEC): Start diagnostic with a lowercase letter. * config/crx/crx.h (FUNCTION_PROFILER): Start diagnostic with a lowercase letter. * config/darwin-c.c (version_as_macro): Start diagnostic with a lowercase letter. * config/darwin-driver.c (darwin_default_min_version): Use %' in diagnostic. * config/host-darwin.c (darwin_gt_pch_use_address): Use %' in diagnostic. * config/i386/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/i386/host-cygwin.c (cygwin_gt_pch_get_address): Use %' in diagnostics. * config/i386/i386.c (ix86_option_override_internal): Write diagnostic as a single sentence without trailing '.'. Use %' in diagnostics. (ix86_function_sseregparm, classify_argument): Start diagnostics with lowercase letters. (ix86_expand_prologue): Use %' in diagnostic. * config/i386/i386.h (CC1_CPU_SPEC_1): Remove trailing '.' from diagnostic. * config/i386/nwld.h (LINK_SPEC): Start diagnostic with a lowercase letter. * config/i386/winnt.c (i386_pe_determine_dllimport_p): Use %' in diagnostic. * config/ia64/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/ia64/ia64.opt (msched-max-memory-insns-hard-limit): Avoid '`' in help text. * config/lm32/lm32.c (lm32_print_operand): Start diagnostic with a lowercase letter. * config/mep/mep.c (mep_validate_vliw): Start diagnostics with lowercase letters. * config/microblaze/microblaze.c (microblaze_handle_option): Remove trailing '.' from diagnostic. (print_operand): Start diagnostic with a lowercase letter. * config/pa/pa-hpux10.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa-hpux11.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa64-hpux.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/picochip/picochip.c (picochip_option_override, picochip_emit_save_register, picochip_function_arg, picochip_output_label, picochip_output_internal_label, picochip_asm_output_opcode, picochip_output_cbranch, picochip_output_compare, picochip_output_branch, picochip_get_vliw_alu_id): Remove trailing '.' and '\n' from diagnostics. Start diagnostics with lowercase letters. Use %' in diagnostics. * config/rs6000/rs6000.c (rs6000_option_override_internal): Use "SPE" capitalization. Start diagnostic with a lowercase letter. (rs6000_handle_option): Start diagnostics with lowercase letters. (def_builtin): Remove trailing '.' from diagnostic. (rs6000_savres_routine_name): Start diagnostic with a lowercase letter. * config/rs6000/sysv4.h (LINK_OS_FREEBSD_SPEC): Avoid '`' in diagnostic. * config/rx/rx.c (rx_handle_option): Start diagnostic with a lowercase letter. * config/s390/s390.c (s390_option_override) Start diagnostics with lowercase letters. Use %' in diagnostic. * config/sh/sh.c (sh_output_mi_thunk): Start diagnostics with lowercase letters. * config/sh/symbian-base.c (sh_symbian_mark_dllimport): Use %' in diagnostic. * config/sh/symbian-c.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sh/symbian-cxx.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sparc/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/spu/spu.c (spu_option_override): Start diagnostics with lowercase letters. Use %qs for quoting in diagnostics. (spu_check_builtin_parm): Remove trailing '.' from diagnostics. Use %wd instead of HOST_WIDE_INT_PRINT_DEC in diagnostic . * config/v850/v850.c (construct_save_jarl): Remove trailing '\n' from diagnostic. * convert.c (convert_to_integer, convert_to_vector): Use %' in diagnostics. * dbgcnt.c (dbg_cnt_process_opt): Start diagnostic with lowercase letter and use "cannot" spelling. * expmed.c (extract_fixed_bit_field): Start diagnostic with lowercase letter and format as a single sentence without '.'. * ggc-common.c (write_pch_globals, gt_pch_save, gt_pch_restore): Use %' in diagnostics. * ggc-page.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * ggc-zone.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * graph.c (clean_graph_dump_file): Use %' in diagnostic. * graphite-poly.c (graphite_read_scop_file): Start diagnostics with lowercase letters and remove tailing '.' and '\n'. * lto-cgraph.c (input_profile_summary): Start diagnostic with lowercase letter and remove trailing '.'. (input_cgraph): Start diagnostics with lowercase letters and remove trailing '\n'. * opts.c (finish_options, common_handle_option): Start diagnostics with lowercase letters and remove trailing '.'. Fix typo in diagnostic. * passes.c (position_pass): Start diagnostic with lowercase letter. * plugin.c (add_new_plugin, parse_plugin_arg_opt, register_callback, try_init_one_plugin): Start diagnostics with lowercase letters. * reload1.c (spill_failure): Use %' in diagnostic. (gen_reload): Start diagnostic with a lowercase letter. * stor-layout.c (place_field): Start diagnostic with a lowercase letter. * toplev.c (open_auxiliary_file): Use %' in diagnostic. * tree-cfg.c (verify_expr, verify_types_in_gimple_reference, verify_gimple_call, verify_gimple_phi, verify_eh_throw_stmt_node): Start diagnostics with lowercase letters, remove trailing '.' and use %' in diagnostics. * tree-ssa.c (verify_def): Remove trailing '.' from diagnostic. (verify_ssa): Don't split diagnostic across two error calls. Spell out "number" and use %' in diagnostic. * value-prof.c (visit_hist, check_counter): Start diagnostics with lowercase letters. c-family: * c-common.c (handle_mode_attribute): Use %' and word "signedness" in diagnostic. * c-opts.c (c_common_parse_file): Start diagnostics with lowercase letter. * c-pragma.c (handle_pragma_target, handle_pragma_optimize): Remove trailing '.' from diagnostics. * c.opt (Wwrite-strings_: Avoid '`' in help text. cp: * cvt.c (cp_convert_to_pointer): Use %' in diagnostic. * decl.c (layout_var_decl, maybe_commonize_var, grokdeclarator): Use %' in diagnostics. * decl2.c (check_classfn): Use %' in diagnostic. * init.c (build_java_class_ref): Use %' in diagnostic. (build_delete): Remove trailing '.' from diagnostic. * method.c (do_build_copy_assign, walk_field_subobs): Use %' in diagnostics. * name-lookup.c (pushdecl_maybe_friend): Use %' in diagnostic. * parser.c (cp_parser_exception_specification_opt): Remove trailing '.' from diagnostic. (cp_parser_objc_interstitial_code): Use %qs for quoting in diagnostic. * pt.c (check_valid_ptrmem_cst_expr): Use %< and %> for quoting in diagnostic. * repo.c (reopen_repo_file_for_write): Use %' in diagnostic. fortran: * trans-array.c (gfc_trans_deferred_array): Use "front-end" spelling in diagnostic. * trans.c (gfc_allocate_array_with_status): Add missing space in diagnostic. java: * expr.c (expand_java_field_op): Use %' in diagnostic. * jcf-parse.c (java_parse_file): Use %' in diagnostics. * jvspec.c (lang_specific_driver): Use %' in diagnostic. * lang.c (java_post_options): Use %' in diagnostics. lto: * lto.c (lto_resolution_read): Start diagnostics with lowercase letters and remove trailing '.'. (lto_file_finalize): Start diagnostic with a lowercase letter. objc: * objc-act.c (objc_init): Use %' in diagnostic. (objc_set_method_opt): Remove trailing '.' from diagnostic. From-SVN: r166570
2010-11-11 00:23:15 +01:00
error ("need a second call-clobbered general purpose register");
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
for (i = FIRST_TARGET_REG; i <= LAST_TARGET_REG; i++)
if (call_used_regs[i] && ! fixed_regs[i])
{
scratch2 = gen_rtx_REG (Pmode, i);
break;
}
if (scratch2 == scratch0)
cfgloop.c (verify_loop_structure): Use %' in diagnostics. * cfgloop.c (verify_loop_structure): Use %' in diagnostics. Start diagnostics with lowercase letters. * cgraphunit.c (verify_cgraph_node): Start diagnostics with lowercase letters. * collect2.c (maybe_run_lto_and_relink): Remove trailing '.' from diagnostic. * config/alpha/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/arm/arm.c (arm_get_pcs_model): Start diagnostics with lowercase letters. * config/arm/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. Remove trailing ' ' from diagnostic. * config/avr/avr.c (print_operand_address): Start diagnostic with a lowercase letter and remove trailing '.'. * config/avr/avr.opt (mpmem-wrap-around): Fix typo in help text. * config/bfin/bfin.c (bfin_option_override): Start diagnostics with lowercase letters. Use %' in diagnostics. Remove trailing '.' from diagnostics. (bfin_handle_longcall_attribute): Use %' in diagnostic. * config/cris/cris.c (cris_split_movdx, cris_expand_pic_call_address): Start diagnostics with lowercase letters. (cris_asm_output_label_ref): Use %' in diagnostic. * config/cris/cris.h (ASM_SPEC): Start diagnostic with a lowercase letter. * config/crx/crx.h (FUNCTION_PROFILER): Start diagnostic with a lowercase letter. * config/darwin-c.c (version_as_macro): Start diagnostic with a lowercase letter. * config/darwin-driver.c (darwin_default_min_version): Use %' in diagnostic. * config/host-darwin.c (darwin_gt_pch_use_address): Use %' in diagnostic. * config/i386/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/i386/host-cygwin.c (cygwin_gt_pch_get_address): Use %' in diagnostics. * config/i386/i386.c (ix86_option_override_internal): Write diagnostic as a single sentence without trailing '.'. Use %' in diagnostics. (ix86_function_sseregparm, classify_argument): Start diagnostics with lowercase letters. (ix86_expand_prologue): Use %' in diagnostic. * config/i386/i386.h (CC1_CPU_SPEC_1): Remove trailing '.' from diagnostic. * config/i386/nwld.h (LINK_SPEC): Start diagnostic with a lowercase letter. * config/i386/winnt.c (i386_pe_determine_dllimport_p): Use %' in diagnostic. * config/ia64/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/ia64/ia64.opt (msched-max-memory-insns-hard-limit): Avoid '`' in help text. * config/lm32/lm32.c (lm32_print_operand): Start diagnostic with a lowercase letter. * config/mep/mep.c (mep_validate_vliw): Start diagnostics with lowercase letters. * config/microblaze/microblaze.c (microblaze_handle_option): Remove trailing '.' from diagnostic. (print_operand): Start diagnostic with a lowercase letter. * config/pa/pa-hpux10.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa-hpux11.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/pa/pa64-hpux.h (LINK_SPEC): Start diagnostics with lowercase letters. Avoid '`' in diagnostics. * config/picochip/picochip.c (picochip_option_override, picochip_emit_save_register, picochip_function_arg, picochip_output_label, picochip_output_internal_label, picochip_asm_output_opcode, picochip_output_cbranch, picochip_output_compare, picochip_output_branch, picochip_get_vliw_alu_id): Remove trailing '.' and '\n' from diagnostics. Start diagnostics with lowercase letters. Use %' in diagnostics. * config/rs6000/rs6000.c (rs6000_option_override_internal): Use "SPE" capitalization. Start diagnostic with a lowercase letter. (rs6000_handle_option): Start diagnostics with lowercase letters. (def_builtin): Remove trailing '.' from diagnostic. (rs6000_savres_routine_name): Start diagnostic with a lowercase letter. * config/rs6000/sysv4.h (LINK_OS_FREEBSD_SPEC): Avoid '`' in diagnostic. * config/rx/rx.c (rx_handle_option): Start diagnostic with a lowercase letter. * config/s390/s390.c (s390_option_override) Start diagnostics with lowercase letters. Use %' in diagnostic. * config/sh/sh.c (sh_output_mi_thunk): Start diagnostics with lowercase letters. * config/sh/symbian-base.c (sh_symbian_mark_dllimport): Use %' in diagnostic. * config/sh/symbian-c.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sh/symbian-cxx.c (sh_symbian_is_dllimported): Use %' in diagnostic. * config/sparc/freebsd.h (LINK_SPEC): Avoid '`' in diagnostic. * config/spu/spu.c (spu_option_override): Start diagnostics with lowercase letters. Use %qs for quoting in diagnostics. (spu_check_builtin_parm): Remove trailing '.' from diagnostics. Use %wd instead of HOST_WIDE_INT_PRINT_DEC in diagnostic . * config/v850/v850.c (construct_save_jarl): Remove trailing '\n' from diagnostic. * convert.c (convert_to_integer, convert_to_vector): Use %' in diagnostics. * dbgcnt.c (dbg_cnt_process_opt): Start diagnostic with lowercase letter and use "cannot" spelling. * expmed.c (extract_fixed_bit_field): Start diagnostic with lowercase letter and format as a single sentence without '.'. * ggc-common.c (write_pch_globals, gt_pch_save, gt_pch_restore): Use %' in diagnostics. * ggc-page.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * ggc-zone.c (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read): Use %' in diagnostics. * graph.c (clean_graph_dump_file): Use %' in diagnostic. * graphite-poly.c (graphite_read_scop_file): Start diagnostics with lowercase letters and remove tailing '.' and '\n'. * lto-cgraph.c (input_profile_summary): Start diagnostic with lowercase letter and remove trailing '.'. (input_cgraph): Start diagnostics with lowercase letters and remove trailing '\n'. * opts.c (finish_options, common_handle_option): Start diagnostics with lowercase letters and remove trailing '.'. Fix typo in diagnostic. * passes.c (position_pass): Start diagnostic with lowercase letter. * plugin.c (add_new_plugin, parse_plugin_arg_opt, register_callback, try_init_one_plugin): Start diagnostics with lowercase letters. * reload1.c (spill_failure): Use %' in diagnostic. (gen_reload): Start diagnostic with a lowercase letter. * stor-layout.c (place_field): Start diagnostic with a lowercase letter. * toplev.c (open_auxiliary_file): Use %' in diagnostic. * tree-cfg.c (verify_expr, verify_types_in_gimple_reference, verify_gimple_call, verify_gimple_phi, verify_eh_throw_stmt_node): Start diagnostics with lowercase letters, remove trailing '.' and use %' in diagnostics. * tree-ssa.c (verify_def): Remove trailing '.' from diagnostic. (verify_ssa): Don't split diagnostic across two error calls. Spell out "number" and use %' in diagnostic. * value-prof.c (visit_hist, check_counter): Start diagnostics with lowercase letters. c-family: * c-common.c (handle_mode_attribute): Use %' and word "signedness" in diagnostic. * c-opts.c (c_common_parse_file): Start diagnostics with lowercase letter. * c-pragma.c (handle_pragma_target, handle_pragma_optimize): Remove trailing '.' from diagnostics. * c.opt (Wwrite-strings_: Avoid '`' in help text. cp: * cvt.c (cp_convert_to_pointer): Use %' in diagnostic. * decl.c (layout_var_decl, maybe_commonize_var, grokdeclarator): Use %' in diagnostics. * decl2.c (check_classfn): Use %' in diagnostic. * init.c (build_java_class_ref): Use %' in diagnostic. (build_delete): Remove trailing '.' from diagnostic. * method.c (do_build_copy_assign, walk_field_subobs): Use %' in diagnostics. * name-lookup.c (pushdecl_maybe_friend): Use %' in diagnostic. * parser.c (cp_parser_exception_specification_opt): Remove trailing '.' from diagnostic. (cp_parser_objc_interstitial_code): Use %qs for quoting in diagnostic. * pt.c (check_valid_ptrmem_cst_expr): Use %< and %> for quoting in diagnostic. * repo.c (reopen_repo_file_for_write): Use %' in diagnostic. fortran: * trans-array.c (gfc_trans_deferred_array): Use "front-end" spelling in diagnostic. * trans.c (gfc_allocate_array_with_status): Add missing space in diagnostic. java: * expr.c (expand_java_field_op): Use %' in diagnostic. * jcf-parse.c (java_parse_file): Use %' in diagnostics. * jvspec.c (lang_specific_driver): Use %' in diagnostic. * lang.c (java_post_options): Use %' in diagnostics. lto: * lto.c (lto_resolution_read): Start diagnostics with lowercase letters and remove trailing '.'. (lto_file_finalize): Start diagnostic with a lowercase letter. objc: * objc-act.c (objc_init): Use %' in diagnostic. (objc_set_method_opt): Remove trailing '.' from diagnostic. From-SVN: r166570
2010-11-11 00:23:15 +01:00
error ("need a call-clobbered target register");
}
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
this_value = plus_constant (Pmode, this_rtx, delta);
if (vcall_offset
&& (simple_add || scratch0 != scratch1)
&& strict_memory_address_p (ptr_mode, this_value))
{
emit_load_ptr (scratch0, this_value);
did_load = 1;
}
if (!delta)
; /* Do nothing. */
else if (simple_add)
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 (this_rtx, this_value);
else
{
emit_move_insn (scratch1, GEN_INT (delta));
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_add2_insn (this_rtx, scratch1));
}
if (vcall_offset)
{
rtx offset_addr;
if (!did_load)
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_load_ptr (scratch0, this_rtx);
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
offset_addr = plus_constant (Pmode, scratch0, vcall_offset);
if (strict_memory_address_p (ptr_mode, offset_addr))
; /* Do nothing. */
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
else if (! TARGET_SH5 && scratch0 != scratch1)
{
/* scratch0 != scratch1, and we have indexed loads. Get better
schedule by loading the offset into r1 and using an indexed
load - then the load of r1 can issue before the load from
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 + delta) finishes. */
emit_move_insn (scratch1, GEN_INT (vcall_offset));
offset_addr = gen_rtx_PLUS (Pmode, scratch0, scratch1);
}
sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). * sh.h (REG_CLASS_FROM_LETTER): Change to: (REG_CLASS_FROM_CONSTRAINT). (CONST_OK_FOR_I): Rename to: (CONST_OK_FOR_I08). Changed all users. (CONST_OK_FOR_J): Rename to: (CONST_OK_FOR_I16). Changed all users. (CONST_OK_FOR_K): Rename to: (CONST_OK_FOR_P27). Changed all users. (CONST_OK_FOR_L): Rename to: (CONST_OK_FOR_K08). Changed all users. (CONST_OK_FOR_O): Rename to: (CONST_OK_FOR_I06). Changed all users. (CONST_OK_FOR_P): Rename to: (CONST_OK_FOR_I10). Changed all users. (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. (CONST_OK_FOR_LETTER_P): Replace with (CONST_OK_FOR_CONSTRAINT_P). (EXTRA_CONSTRAINT_S): Rename to: (EXTRA_CONSTRAINT_C16). Changed all users. (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. (EXTRA_CONSTRAINT_T): Rename to: (EXTRA_CONSTRAINT_Csy). Changed all users. (EXTRA_CONSTRAINT_Z): Remove. (EXTRA_CONSTRAINT): Replace with: (EXTRA_CONSTRAINT_STR). (EXTRA_CONSTRAINT_U): Rename to: (EXTRA_CONSTRAINT_Z). Changed all users. * sh.c (and_operand): Use CONST_OK_FOR_J16. * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. (sssubv4hi3): Likewise. (movsf_i): Change I[08]/r to G/r. (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. From-SVN: r68022
2003-06-16 18:23:30 +02:00
else if (CONST_OK_FOR_ADD (vcall_offset))
{
emit_insn (gen_add2_insn (scratch0, GEN_INT (vcall_offset)));
offset_addr = scratch0;
}
else if (scratch0 != scratch1)
{
emit_move_insn (scratch1, GEN_INT (vcall_offset));
emit_insn (gen_add2_insn (scratch0, scratch1));
offset_addr = scratch0;
}
else
gcc_unreachable (); /* FIXME */
emit_load_ptr (scratch0, offset_addr);
if (Pmode != ptr_mode)
scratch0 = gen_rtx_TRUNCATE (ptr_mode, scratch0);
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_add2_insn (this_rtx, scratch0));
}
/* 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);
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* If the function is overridden, so is the thunk, hence we don't
need GOT addressing even if this is a public symbol. */
#if 0
if (TARGET_SH1 && ! flag_weak)
sibcall = gen_sibcalli_thunk (funexp, const0_rtx);
else
#endif
if (TARGET_SH2 && flag_pic)
{
sibcall = gen_sibcall_pcrel (funexp, const0_rtx);
XEXP (XVECEXP (sibcall, 0, 2), 0) = scratch2;
}
else
{
if (TARGET_SHMEDIA && flag_pic)
{
funexp = gen_sym2PIC (funexp);
PUT_MODE (funexp, Pmode);
}
emit_move_insn (scratch2, funexp);
funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2);
sibcall = gen_sibcall (funexp, const0_rtx, NULL_RTX);
}
sibcall = emit_call_insn (sibcall);
SIBLING_CALL_P (sibcall) = 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
use_reg (&CALL_INSN_FUNCTION_USAGE (sibcall), this_rtx);
emit_barrier ();
/* Run just enough of rest_of_compilation to do scheduling and get
the insns emitted. Note that use_thunk calls
assemble_start_function and assemble_end_function. */
insns = get_insns ();
if (optimize > 0)
{
if (! cfun->cfg)
init_flow (cfun);
split_all_insns_noflow ();
}
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
sh_reorg ();
shorten_branches (insns);
final_start_function (insns, file, 1);
final (insns, 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;
}
rtx
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
function_symbol (rtx target, const char *name, enum sh_function_kind kind)
{
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
rtx sym;
/* If this is not an ordinary function, the name usually comes from a
string literal or an sprintf buffer. Make sure we use the same
string consistently, so that cse will be able to unify address loads. */
if (kind != FUNCTION_ORDINARY)
name = IDENTIFIER_POINTER (get_identifier (name));
sym = gen_rtx_SYMBOL_REF (Pmode, name);
SYMBOL_REF_FLAGS (sym) = SYMBOL_FLAG_FUNCTION;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (flag_pic)
switch (kind)
{
case FUNCTION_ORDINARY:
break;
case SFUNC_GOT:
{
rtx reg = target ? target : gen_reg_rtx (Pmode);
emit_insn (gen_symGOT2reg (reg, sym));
sym = reg;
break;
}
case SFUNC_STATIC:
{
/* ??? To allow cse to work, we use GOTOFF relocations.
we could add combiner patterns to transform this into
straight pc-relative calls with sym2PIC / bsrf when
label load and function call are still 1:1 and in the
same basic block during combine. */
rtx reg = target ? target : gen_reg_rtx (Pmode);
emit_insn (gen_symGOTOFF2reg (reg, sym));
sym = reg;
break;
}
}
if (target && sym != target)
{
emit_move_insn (target, sym);
return target;
}
return sym;
}
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
/* Find the number of a general purpose register in S. */
static int
scavenge_reg (HARD_REG_SET *s)
{
int r;
for (r = FIRST_GENERAL_REG; r <= LAST_GENERAL_REG; r++)
if (TEST_HARD_REG_BIT (*s, r))
return r;
return -1;
}
rtx
sh_get_pr_initial_val (void)
{
rtx val;
/* ??? Unfortunately, get_hard_reg_initial_val doesn't always work for the
PR register on SHcompact, because it might be clobbered by the prologue.
We check first if that is known to be the case. */
if (TARGET_SHCOMPACT
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->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
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->saves_all_registers))
return gen_frame_mem (SImode, return_address_pointer_rtx);
/* If we haven't finished rtl generation, there might be a nonlocal label
that we haven't seen yet.
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
??? get_hard_reg_initial_val fails if it is called after register
allocation has started, unless it has been called before for the
same register. And even then, we end in trouble if we didn't use
the register in the same basic block before. So call
get_hard_reg_initial_val now and wrap it in an unspec if we might
need to replace it. */
/* ??? We also must do this for TARGET_SH1 in general, because otherwise
combine can put the pseudo returned by get_hard_reg_initial_val into
instructions that need a general purpose registers, which will fail to
be recognized when the pseudo becomes allocated to PR. */
val
= get_hard_reg_initial_val (Pmode, TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG);
if (TARGET_SH1)
return gen_rtx_UNSPEC (SImode, gen_rtvec (1, val), UNSPEC_RA);
return val;
prologue / epilogue / warning patches: 2003-07-16 J"orn Rennecke <joern.rennecke@superh.com> Con Bradley <con.bradley@superh.com> * sh-protos.h (sh_get_pr_initial_val): Declare. * sh.c (regno_reg_class): Make its elements type enum reg_class. (output_stack_adjust): Remove emit_fn argument. Add epilogue_p and live_regs_mask arguments. Changed all callers. (save_schedule_s): New structure. (save_schedule): New typedef. (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. In interrupts handlers, also save registers that are usually partially saved, and make sure there is at least one general purpose register saved if a target register needs saving. Add casts in comparisons to avoid warnings. (sh_media_register_for_return): return -1 for interrupt handlers. (MAX_SAVED_REGS, MAX_TEMPS): New defines. (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp registers used are available. Set RTX_FRAME_RELATED_P where appropriate. Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. (initial_elimination_offset): Likewise. * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, and for target registers. (RETURN_IN_MEMORY): Add parentheses to avoid warnings. (regno_reg_class): Make its elements type enum reg_class. (CONSTRAINT_LEN): Don't use isdigit. (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. (FUNCTION_ARG): Add parentheses to avoid warnings. (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. * sh.md (xordi3+1): Remove unused variable regno. (return_media): Check that tr0 is available before using it. Co-Authored-By: Con Bradley <con.bradley@superh.com> From-SVN: r69480
2003-07-16 23:41:20 +02:00
}
bool
sh_expand_t_scc (rtx operands[])
{
enum rtx_code code = GET_CODE (operands[1]);
rtx target = operands[0];
rtx op0 = operands[2];
rtx op1 = operands[3];
rtx result = target;
HOST_WIDE_INT val;
if (!REG_P (op0) || REGNO (op0) != T_REG
|| !CONST_INT_P (op1))
return false;
if (!REG_P (result))
result = gen_reg_rtx (SImode);
val = INTVAL (op1);
if ((code == EQ && val == 1) || (code == NE && val == 0))
emit_insn (gen_movt (result, get_t_reg_rtx ()));
else if ((code == EQ && val == 0) || (code == NE && val == 1))
emit_insn (gen_movnegt (result, get_t_reg_rtx ()));
else if (code == EQ || code == NE)
emit_insn (gen_move_insn (result, GEN_INT (code == NE)));
else
return false;
if (result != target)
emit_move_insn (target, result);
return true;
}
/* INSN is an sfunc; return the rtx that describes the address used. */
static rtx
extract_sfunc_addr (rtx insn)
{
rtx pattern, part = NULL_RTX;
int len, i;
pattern = PATTERN (insn);
len = XVECLEN (pattern, 0);
for (i = 0; i < len; i++)
{
part = XVECEXP (pattern, 0, i);
if (GET_CODE (part) == USE && GET_MODE (XEXP (part, 0)) == Pmode
&& GENERAL_REGISTER_P (true_regnum (XEXP (part, 0))))
return XEXP (part, 0);
}
gcc_assert (GET_CODE (XVECEXP (pattern, 0, 0)) == UNSPEC_VOLATILE);
return XVECEXP (XVECEXP (pattern, 0, 0), 0, 1);
}
/* Verify that the register in use_sfunc_addr still agrees with the address
used in the sfunc. This prevents fill_slots_from_thread from changing
use_sfunc_addr.
INSN is the use_sfunc_addr instruction, and REG is the register it
guards. */
bool
check_use_sfunc_addr (rtx insn, rtx reg)
{
/* Search for the sfunc. It should really come right after INSN. */
while ((insn = NEXT_INSN (insn)))
{
if (LABEL_P (insn) || JUMP_P (insn))
break;
if (! INSN_P (insn))
continue;
if (GET_CODE (PATTERN (insn)) == SEQUENCE)
insn = XVECEXP (PATTERN (insn), 0, 0);
if (GET_CODE (PATTERN (insn)) != PARALLEL
|| get_attr_type (insn) != TYPE_SFUNC)
continue;
return rtx_equal_p (extract_sfunc_addr (insn), reg);
}
gcc_unreachable ();
}
/* This function returns a constant rtx that represents 2**15 / pi in
SFmode. It's used to scale a fixed-point signed 16.16-bit fraction
of a full circle back to an SFmode value, i.e. 0x10000 maps to 2*pi. */
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
static GTY(()) rtx sh_fsca_sf2int_rtx;
rtx
sh_fsca_sf2int (void)
{
if (! sh_fsca_sf2int_rtx)
{
REAL_VALUE_TYPE rv;
real_from_string (&rv, "10430.378350470453");
sh_fsca_sf2int_rtx = const_double_from_real_value (rv, SFmode);
}
return sh_fsca_sf2int_rtx;
}
/* This function returns a constant rtx that represents pi / 2**15 in
SFmode. It's used to scale SFmode angles, in radians, to a
fixed-point signed 16.16-bit fraction of a full circle, i.e. 2*pi
maps to 0x10000. */
Introduce sh4a support. gcc/ChangeLog: Introduce sh4a support. * config.gcc: Handle sh4a multilibs and cpu selection. * config/sh/sh.h: Likewise. Handle sh4a command line flags. * config/sh/t-mlib-sh4a: New. * config/sh/t-mlib-sh4al: New. * config/sh/t-mlib-sh4a-nofpu: New. * config/sh/t-mlib-sh4a-single: New. * config/sh/t-mlib-sh4a-single-only: New. 2004-02-20 DJ Delorie <dj@redhat.com> * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. 2003-08-22 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: Update for chip errata. 2003-08-07 Eric Christopher <echristo@redhat.com> * config/sh/sh4a.md: New file. sh4a processor description. 2003-07-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description of -m4a-nofpu. (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. * doc/invoke.texi (SH Options): Document -m4al. 2003-07-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Remove commented-out code checked in by mistake. (sh_cannot_change_mode_class): Enable SUBREGs to be used to select single elements from SFmode vectors. * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output register. (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Remove variable declarations. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New functions. (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, sh_fsca_int2sf_rtx): New static variables. * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. * config/sh/sh.md: Adjust. * doc/invoke.texi (SH Options): Document new options. * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward compatibility from SH4 code. 2003-06-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (expand_block_move): Don't emit POST_INC too early. (memory_movsrc_operand): Renamed to... (unaligned_load_operand): ... this. Simplified. * config/sh/sh.h (PREDICATE_CODES): Adjust. * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's input operand to SImode, and adjust the others. Introduce post-increment by peephole. * config/sh/sh.c (expand_block_move): Give the target address the same mode as the temp reg. * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned copying. 2003-06-26 Alexandre Oliva <aoliva@redhat.com> Introduce support for SH4a. * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): New. (sh_init_builtins): Initialize them. (print_operand): Support `d'. (expand_block_move): Use movua if src is misaligned. (memory_movsrc_operand): New. * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ and one of the SH4 macros. (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, SELECT_SH4A_SINGLE): New. (TARGET_NONE): Add SH4A_BIT. (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. (enum processor_type): Added PROCESSOR_SH4A. (PREDICATE_CODES): Add memory_movsrc_operand. * config/sh/sh.md: Removed unused variables. (attr cpu): Add sh4a. (attr type): Add movua, fsrra and fsca. (prefetch): New, for SH4. (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. (toggle_sz): Set type to fp. (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. (movua, extv, extzv): New. * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single and 4a-single-only. gcc/testsuite/ChangeLog: 2003-07-06 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-memmovua.c: Tweak regular expression. 2003-07-01 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/sh4a-bitmovua.c: New. * gcc.dg/sh4a-cos.c: New. * gcc.dg/sh4a-cosf.c: New. * gcc.dg/sh4a-fprun.c: New. * gcc.dg/sh4a-fsrra.c: New. * gcc.dg/sh4a-memmovua.c: New. * gcc.dg/sh4a-sin.c: New. * gcc.dg/sh4a-sincos.c: New. * gcc.dg/sh4a-sincosf.c: New. * gcc.dg/sh4a-sinf.c: New. libstdc++-v3/ChangeLog: 2003-10-01 Eric Christopher <echristo@redhat.com> * config/cpu/sh/atomicity.h (__exchange_and_add): Remove 'm' constraint. 2003-07-09 Alexandre Oliva <aoliva@redhat.com> * config/cpu/sh/atomicity.h: New. Use movli and movco on SH4a. From-SVN: r85257
2004-07-28 11:13:58 +02:00
static GTY(()) rtx sh_fsca_int2sf_rtx;
rtx
sh_fsca_int2sf (void)
{
if (! sh_fsca_int2sf_rtx)
{
REAL_VALUE_TYPE rv;
real_from_string (&rv, "9.587379924285257e-5");
sh_fsca_int2sf_rtx = const_double_from_real_value (rv, SFmode);
}
return sh_fsca_int2sf_rtx;
}
/* Initialize the CUMULATIVE_ARGS structure. */
void
sh_init_cumulative_args (CUMULATIVE_ARGS * pcum,
tree fntype,
rtx libname ATTRIBUTE_UNUSED,
tree fndecl,
signed int n_named_args,
enum machine_mode mode)
{
pcum->arg_count [(int) SH_ARG_FLOAT] = 0;
pcum->free_single_fp_reg = 0;
pcum->stack_regs = 0;
pcum->byref_regs = 0;
pcum->byref = 0;
pcum->outgoing = (n_named_args == -1) ? 0 : 1;
/* XXX - Should we check TARGET_HITACHI here ??? */
pcum->renesas_abi = sh_attr_renesas_p (fntype) ? 1 : 0;
if (fntype)
{
pcum->force_mem = ((TARGET_HITACHI || pcum->renesas_abi)
&& aggregate_value_p (TREE_TYPE (fntype), fndecl));
pcum->prototype_p = prototype_p (fntype);
pcum->arg_count [(int) SH_ARG_INT]
= TARGET_SH5 && aggregate_value_p (TREE_TYPE (fntype), fndecl);
pcum->call_cookie
= CALL_COOKIE_RET_TRAMP (TARGET_SHCOMPACT
&& pcum->arg_count [(int) SH_ARG_INT] == 0
&& (TYPE_MODE (TREE_TYPE (fntype)) == BLKmode
? int_size_in_bytes (TREE_TYPE (fntype))
: GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (fntype)))) > 4
&& (BASE_RETURN_VALUE_REG (TYPE_MODE (TREE_TYPE (fntype)))
== FIRST_RET_REG));
}
else
{
pcum->arg_count [(int) SH_ARG_INT] = 0;
pcum->prototype_p = FALSE;
if (mode != VOIDmode)
{
pcum->call_cookie =
CALL_COOKIE_RET_TRAMP (TARGET_SHCOMPACT
&& GET_MODE_SIZE (mode) > 4
&& BASE_RETURN_VALUE_REG (mode) == FIRST_RET_REG);
/* If the default ABI is the Renesas ABI then all library
calls must assume that the library will be using the
Renesas ABI. So if the function would return its result
in memory then we must force the address of this memory
block onto the stack. Ideally we would like to call
targetm.calls.return_in_memory() here but we do not have
the TYPE or the FNDECL available so we synthesize the
contents of that function as best we can. */
pcum->force_mem =
config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. * config/sh/sh.h: Update mask names throughout. (target_flags, ISIZE_BIT, DALIGN_BIT, SH1_BIT, SH2_BIT, SH3_BIT) (SH_E_BIT, HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, SH4A_BIT, FMOVD_BIT) (SH5_BIT, SPACE_BIT, BIGTABLE_BIT, RELAX_BIT, USERMODE_BIT) (HITACHI_BIT, NOMACSAVE_BIT, PREFERGOT_BIT, PADSTRUCT_BIT) (LITTLE_ENDIAN_BIT, IEEE_BIT, SAVE_ALL_TR_BIT, HARD_SH2A_BIT) (HARD_SH2A_DOUBLE_BIT, INDEXED_ADDRESS_BIT, PT_FIXED_BIT) (INVALID_SYMBOLS_BIT, ADJUST_UNROLL_BIT, TARGET_DUMPISIZE) (TARGET_ALIGN_DOUBLE, TARGET_SH1, TARGET_SH2, TARGET_SH3) (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH5, TARGET_FMOVD) (TARGET_IEEE, TARGET_SMALLCODE, TARGET_BIGTABLE, TARGET_RELAX) (TARGET_HITACHI, TARGET_NOMACSAVE, TARGET_PADSTRUCT) (TARGET_LITTLE_ENDIAN, TARGET_USERMODE, TARGET_PREFERGOT) (TARGET_SAVE_ALL_TARGET_REGS, TARGET_ALLOW_INDEXED_ADDRESS) (TARGET_PT_FIXED, TARGET_INVALID_SYMBOLS, TARGET_ADJUST_UNROLL) (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E) (TARGET_SWITCH_SH2A, TARGET_SWITCH_SH2A_SINGLE_ONLY) (TARGET_SWITCH_SH2A_SINGLE, TARGET_SWITCH_SH2A_NOFPU) (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E, TARGET_SWITCH_SH4_SINGLE_ONLY) (TARGET_SWITCH_SH4_SINGLE, TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4) (TARGET_SWITCH_SH4A, TARGET_SWITCH_SH4A_SINGLE_ONLY) (TARGET_SWITCH_SH4A_SINGLE, TARGET_SWITCH_SH4A_NOFPU) (TARGET_SWITCH_SH4AL, TARGET_SWITCH_SH5_64MEDIA) (TARGET_SWITCH_SH5_64MEDIA_NOFPU, TARGET_SWITCHES_SH5_32MEDIA) (TARGET_SWITCHES_SH5_32MEDIA_NOFPU, TARGET_SWITCH_SH5_32_ANY_EXTRA) (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA, TARGET_SWITCHES) (SUBTARGET_SWITCHES): Delete. (TARGET_SH2E, TARGET_SH2A, TARGET_SH2A_SINGLE, TARGET_SH2A_DOUBLE) (TARGET_SH3E, TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARVARD) (TARGET_FPU_DOUBLE, TARGET_SH4A_ARCH, TARGET_SHMEDIA32) (TARGET_SHMEDIA64): Redefine using other TARGET_* macros. (TARGET_SH4): Undefine options.h definition and check MASK_SH1 as well. (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4, SUPPORT_SH4_SINGLE) (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Make numeric. (SUPPORT_SH2): Define to 1 if SUPPORT_SH1. (SUPPORT_SH3): Likewise SUPPORT_SH2. (SUPPORT_SH4_NOFPU): Likewise SUPPORT_SH3. (SUPPORT_SH4A_NOFPU, SUPPORT_SH4AL, SUPPORT_SH2A_NOFPU): Likewise SUPPORT_SH4_NOFPU. (SUPPORT_SH3E): Likewise SUPPORT_SH2E. (SUPPORT_SH4_SINGLE_ONLY, SUPPORT_SH4A_SINGLE_ONLY) (SUPPORT_SH2A_SINGLE_ONLY): Likewise SUPPORT_SH3E. (SUPPORT_SH4A): Likewise SUPPORT_SH4. (SUPPORT_SH4A_SINGLE): Likewise SUPPORT_SH4_SINGLE. (SUPPORT_SH5_32MEDIA): Likewise SUPPORT_SH5_COMPACT. (SUPPORT_SH5_32MEDIA_NOFPU): Likewise SUPPORT_SH5_COMPACT_NOFPU. (SUPPORT_ANY_SH5_32MEDIA, SUPPORT_ANY_SH5_64MEDIA) (SUPPORT_ANY_SH5): New macros. (TARGET_NONE): Replace with... (MASK_ARCH): ...this new macro. * config/sh/elf.h: Update mask names * config/sh/linux.h: Likewise. * config/sh/little.h: Likewise. * config/sh/netbsd-elf.h: Likewise. * config/sh/symbian-pre.h: Likewise. * config/sh/sh.c (sh_handle_option): New function. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. (calc_live_regs): Use MASK_FPU_SINGLE instead of FPU_SINGLE_BIT. (sh_target_switches, target_switches): Delete. (sh_pch_valid_p): Check for specific differences in the target_flags settings. (sh_init_cumulative_args): Use MASK_HITACHI instead of HITACHI_BIT. * config/sh/sh.opt: New file. From-SVN: r99916
2005-05-18 20:43:53 +02:00
(TARGET_DEFAULT & MASK_HITACHI)
&& (mode == BLKmode
|| (GET_MODE_SIZE (mode) > 4
&& !(mode == DFmode
&& TARGET_FPU_DOUBLE)));
}
else
{
pcum->call_cookie = 0;
pcum->force_mem = FALSE;
}
}
}
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* Replace any occurrence of FROM(n) in X with TO(n). The function does
not enter into CONST_DOUBLE for the replace.
Note that copying is not done so X must not be shared unless all copies
are to be modified.
This is like replace_rtx, except that we operate on N_REPLACEMENTS
replacements simultaneously - FROM(n) is replacements[n*2] and to(n) is
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
replacements[n*2+1] - and that we take mode changes into account.
If a replacement is ambiguous, return NULL_RTX.
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
If MODIFY is zero, don't modify any rtl in place,
just return zero or nonzero for failure / success. */
rtx
replace_n_hard_rtx (rtx x, rtx *replacements, int n_replacements, int modify)
{
int i, j;
const char *fmt;
/* The following prevents loops occurrence when we change MEM in
CONST_DOUBLE onto the same CONST_DOUBLE. */
if (x != NULL_RTX && GET_CODE (x) == CONST_DOUBLE)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
return x;
for (i = n_replacements - 1; i >= 0 ; i--)
if (x == replacements[i*2] && GET_MODE (x) == GET_MODE (replacements[i*2+1]))
return replacements[i*2+1];
/* Allow this function to make replacements in EXPR_LISTs. */
if (x == NULL_RTX)
return NULL_RTX;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (GET_CODE (x) == SUBREG)
{
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 new_rtx = replace_n_hard_rtx (SUBREG_REG (x), replacements,
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
n_replacements, modify);
if (CONST_INT_P (new_rtx))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +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
x = simplify_subreg (GET_MODE (x), new_rtx,
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x));
if (! x)
abort ();
}
else if (modify)
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
SUBREG_REG (x) = new_rtx;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
return x;
}
else if (REG_P (x))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{
unsigned regno = REGNO (x);
unsigned nregs = (regno < FIRST_PSEUDO_REGISTER
? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1);
rtx result = NULL_RTX;
for (i = n_replacements - 1; i >= 0; i--)
{
rtx from = replacements[i*2];
rtx to = replacements[i*2+1];
unsigned from_regno, from_nregs, to_regno, new_regno;
if (!REG_P (from))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
continue;
from_regno = REGNO (from);
from_nregs = (from_regno < FIRST_PSEUDO_REGISTER
? HARD_REGNO_NREGS (from_regno, GET_MODE (from)) : 1);
if (regno < from_regno + from_nregs && regno + nregs > from_regno)
{
if (regno < from_regno
|| regno + nregs > from_regno + nregs
|| !REG_P (to)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
|| result)
return NULL_RTX;
to_regno = REGNO (to);
if (to_regno < FIRST_PSEUDO_REGISTER)
{
new_regno = regno + to_regno - from_regno;
if ((unsigned) HARD_REGNO_NREGS (new_regno, GET_MODE (x))
!= nregs)
return NULL_RTX;
result = gen_rtx_REG (GET_MODE (x), new_regno);
}
else if (GET_MODE (x) <= GET_MODE (to))
result = gen_lowpart_common (GET_MODE (x), to);
else
result = gen_lowpart_SUBREG (GET_MODE (x), to);
}
}
return result ? result : x;
}
else if (GET_CODE (x) == ZERO_EXTEND)
{
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 new_rtx = replace_n_hard_rtx (XEXP (x, 0), replacements,
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
n_replacements, modify);
if (CONST_INT_P (new_rtx))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{
x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (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
new_rtx, GET_MODE (XEXP (x, 0)));
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (! x)
abort ();
}
else if (modify)
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
XEXP (x, 0) = new_rtx;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
return x;
}
fmt = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
{
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 new_rtx;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
if (fmt[i] == 'e')
{
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
new_rtx = replace_n_hard_rtx (XEXP (x, i), replacements,
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
n_replacements, modify);
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
if (!new_rtx)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
return NULL_RTX;
if (modify)
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
XEXP (x, i) = new_rtx;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
}
else if (fmt[i] == 'E')
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
{
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
new_rtx = replace_n_hard_rtx (XVECEXP (x, i, j), replacements,
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
n_replacements, modify);
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
if (!new_rtx)
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
return NULL_RTX;
if (modify)
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
XVECEXP (x, i, j) = new_rtx;
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
}
}
return x;
}
rtx
sh_gen_truncate (enum machine_mode mode, rtx x, int need_sign_ext)
{
enum rtx_code code = TRUNCATE;
if (GET_CODE (x) == ZERO_EXTEND || GET_CODE (x) == SIGN_EXTEND)
{
rtx inner = XEXP (x, 0);
enum machine_mode inner_mode = GET_MODE (inner);
if (inner_mode == mode)
return inner;
else if (GET_MODE_SIZE (inner_mode) >= GET_MODE_SIZE (mode))
x = inner;
else if (GET_MODE_SIZE (inner_mode) < GET_MODE_SIZE (mode)
&& (! need_sign_ext || GET_CODE (x) == SIGN_EXTEND))
{
code = GET_CODE (x);
x = inner;
}
}
return gen_rtx_fmt_e (code, mode, x);
}
/* called via for_each_rtx after reload, to clean up truncates of
registers that span multiple actual hard registers. */
int
shmedia_cleanup_truncate (rtx *p, void *n_changes)
{
rtx x = *p, reg;
if (GET_CODE (x) != TRUNCATE)
return 0;
reg = XEXP (x, 0);
if (GET_MODE_SIZE (GET_MODE (reg)) > 8 && REG_P (reg))
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
{
enum machine_mode reg_mode = GET_MODE (reg);
XEXP (x, 0) = simplify_subreg (DImode, reg, reg_mode,
subreg_lowpart_offset (DImode, reg_mode));
*(int*) n_changes += 1;
return -1;
}
return 0;
}
/* Load and store depend on the highpart of the address. However,
set_attr_alternative does not give well-defined results before reload,
so we must look at the rtl ourselves to see if any of the feeding
registers is used in a memref. */
/* Called by sh_contains_memref_p via for_each_rtx. */
static int
sh_contains_memref_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
{
return (MEM_P (*loc));
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
}
/* Return true iff INSN contains a MEM. */
bool
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
sh_contains_memref_p (rtx insn)
{
return for_each_rtx (&PATTERN (insn), &sh_contains_memref_p_1, NULL);
}
/* Return true iff INSN loads a banked register. */
bool
sh_loads_bankedreg_p (rtx insn)
{
if (GET_CODE (PATTERN (insn)) == SET)
{
rtx op = SET_DEST (PATTERN(insn));
if (REG_P (op) && BANKED_REGISTER_P (REGNO (op)))
return true;
}
return false;
}
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
/* FNADDR is the MEM expression from a call expander. Return an address
to use in an SHmedia insn pattern. */
rtx
shmedia_prepare_call_address (rtx fnaddr, int is_sibcall)
{
int is_sym;
fnaddr = XEXP (fnaddr, 0);
is_sym = GET_CODE (fnaddr) == SYMBOL_REF;
if (flag_pic && is_sym)
{
if (! SYMBOL_REF_LOCAL_P (fnaddr))
{
rtx reg = gen_reg_rtx (Pmode);
/* We must not use GOTPLT for sibcalls, because PIC_REG
must be restored before the PLT code gets to run. */
if (is_sibcall)
emit_insn (gen_symGOT2reg (reg, fnaddr));
else
emit_insn (gen_symGOTPLT2reg (reg, fnaddr));
fnaddr = reg;
}
else
{
fnaddr = gen_sym2PIC (fnaddr);
PUT_MODE (fnaddr, Pmode);
}
}
/* If ptabs might trap, make this visible to the rest of the compiler.
We generally assume that symbols pertain to valid locations, but
it is possible to generate invalid symbols with asm or linker tricks.
In a list of functions where each returns its successor, an invalid
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
symbol might denote an empty list. */
if (!TARGET_PT_FIXED
&& (!is_sym || TARGET_INVALID_SYMBOLS)
&& (!REG_P (fnaddr) || ! TARGET_REGISTER_P (REGNO (fnaddr))))
{
rtx tr = gen_reg_rtx (PDImode);
emit_insn (gen_ptabs (tr, fnaddr));
fnaddr = tr;
}
else if (! target_reg_operand (fnaddr, Pmode))
fnaddr = copy_to_mode_reg (Pmode, fnaddr);
return fnaddr;
}
/* Implement TARGET_PREFERRED_RELOAD_CLASS. */
static reg_class_t
sh_preferred_reload_class (rtx x, reg_class_t rclass)
{
if (rclass == NO_REGS
&& TARGET_SHMEDIA
&& (CONST_DOUBLE_P (x)
|| GET_CODE (x) == SYMBOL_REF
|| PIC_ADDR_P (x)))
return GENERAL_REGS;
return rclass;
}
/* Implement TARGET_SECONDARY_RELOAD. */
static reg_class_t
re PR middle-end/44566 (configuration with multiple targets / backends is not supported.) PR other/44566 * coretypes.h [!USED_FOR_TARGET] (reg_class_t): Define. * target.def (struct gcc_target): Replace enum reg_class with reg_class_t in hook argument / return types. * doc/tm.texi.in (TARGET_SECONDARY_RELOAD): Likewise. (TARGET_IRA_COVER_CLASSES, TARGET_MEMORY_MOVE_COST): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise. * targhooks.h (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * targhooks.c (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * reload.c (push_secondary_reload, secondary_reload_class): Likewise. * bt-load.c (branch_target_load_optimize): Likewise. * ira.c (setup_cover_and_important_classes): Likewise. * ira-costs.c (copy_cost): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_secondary_reload): Likewise. * config/s390/s390.c (s390_secondary_reload): Likewise. * config/i386/i386.c (i386_ira_cover_classes): Likewise. (ix86_secondary_reload, ix86_memory_move_cost): Likewise. (ix86_register_move_cost): Likewise. * config/sh/sh-protos.h (sh_secondary_reload): Likewise. * config/sh/sh.c (sh_target_reg_class, sh_secondary_reload): Likewise. * config/xtensa/xtensa.c (xtensa_secondary_reload): Likewise. * config/xtensa/xtensa-protos.h (xtensa_secondary_reload): Likewise. * config/rs6000/rs6000.c (rs6000_secondary_reload): Likewise. (rs6000_ira_cover_classes): Likewise. * config/picochip/picochip.c (picochip_secondary_reload): Likewise. * config/picochip/picochip-protos.h (picochip_secondary_reload): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * config/mips/mips.c (mips_ira_cover_classes): Likewise. * config/bfin/bfin.c (bfin_secondary_reload): Likewise. * config/ia64/ia64.c (ia64_register_move_cost): Likewise. * doc/tm.texi: Regenerate. From-SVN: r161633
2010-06-30 20:47:43 +02:00
sh_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
enum machine_mode mode, secondary_reload_info *sri)
{
re PR middle-end/44566 (configuration with multiple targets / backends is not supported.) PR other/44566 * coretypes.h [!USED_FOR_TARGET] (reg_class_t): Define. * target.def (struct gcc_target): Replace enum reg_class with reg_class_t in hook argument / return types. * doc/tm.texi.in (TARGET_SECONDARY_RELOAD): Likewise. (TARGET_IRA_COVER_CLASSES, TARGET_MEMORY_MOVE_COST): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise. * targhooks.h (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * targhooks.c (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * reload.c (push_secondary_reload, secondary_reload_class): Likewise. * bt-load.c (branch_target_load_optimize): Likewise. * ira.c (setup_cover_and_important_classes): Likewise. * ira-costs.c (copy_cost): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_secondary_reload): Likewise. * config/s390/s390.c (s390_secondary_reload): Likewise. * config/i386/i386.c (i386_ira_cover_classes): Likewise. (ix86_secondary_reload, ix86_memory_move_cost): Likewise. (ix86_register_move_cost): Likewise. * config/sh/sh-protos.h (sh_secondary_reload): Likewise. * config/sh/sh.c (sh_target_reg_class, sh_secondary_reload): Likewise. * config/xtensa/xtensa.c (xtensa_secondary_reload): Likewise. * config/xtensa/xtensa-protos.h (xtensa_secondary_reload): Likewise. * config/rs6000/rs6000.c (rs6000_secondary_reload): Likewise. (rs6000_ira_cover_classes): Likewise. * config/picochip/picochip.c (picochip_secondary_reload): Likewise. * config/picochip/picochip-protos.h (picochip_secondary_reload): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * config/mips/mips.c (mips_ira_cover_classes): Likewise. * config/bfin/bfin.c (bfin_secondary_reload): Likewise. * config/ia64/ia64.c (ia64_register_move_cost): Likewise. * doc/tm.texi: Regenerate. From-SVN: r161633
2010-06-30 20:47:43 +02:00
enum reg_class rclass = (enum reg_class) rclass_i;
if (MEM_P (x) && GET_CODE (XEXP (x, 0)) == PLUS
&& REG_P (XEXP (XEXP (x, 0), 0))
&& REGNO (XEXP (XEXP (x, 0), 0)) == GBR_REG)
return rclass == R0_REGS ? NO_REGS : R0_REGS;
if (MEM_P (x) && REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) == GBR_REG)
return rclass == R0_REGS ? NO_REGS : R0_REGS;
if (REG_P (x) && REGNO (x) == GBR_REG)
return NO_REGS;
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
if (in_p)
{
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
if (REGCLASS_HAS_FP_REG (rclass)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& ! TARGET_SHMEDIA
&& immediate_operand ((x), mode)
&& ! ((fp_zero_operand (x) || fp_one_operand (x))
&& mode == SFmode && fldi_ok ()))
switch (mode)
{
case SFmode:
sri->icode = CODE_FOR_reload_insf__frn;
return NO_REGS;
case DFmode:
sri->icode = CODE_FOR_reload_indf__frn;
return NO_REGS;
case SImode:
/* ??? If we knew that we are in the appropriate mode -
single precision - we could use a reload pattern directly. */
return FPUL_REGS;
default:
abort ();
}
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
if (rclass == FPUL_REGS
&& ((REG_P (x)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& (REGNO (x) == MACL_REG || REGNO (x) == MACH_REG
|| REGNO (x) == T_REG))
|| GET_CODE (x) == PLUS))
return GENERAL_REGS;
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
if (rclass == FPUL_REGS && immediate_operand (x, mode))
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
{
if (satisfies_constraint_I08 (x) || fp_zero_operand (x))
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
return GENERAL_REGS;
else if (mode == SFmode)
return FP_REGS;
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
sri->icode = CODE_FOR_reload_insi__i_fpul;
return NO_REGS;
}
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
if (rclass == FPSCR_REGS
&& ((REG_P (x) && REGNO (x) >= FIRST_PSEUDO_REGISTER)
|| (MEM_P (x) && GET_CODE (XEXP (x, 0)) == PLUS)))
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
return GENERAL_REGS;
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
if (REGCLASS_HAS_FP_REG (rclass)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& TARGET_SHMEDIA
&& immediate_operand (x, mode)
&& x != CONST0_RTX (GET_MODE (x))
&& GET_MODE (x) != V4SFmode)
return GENERAL_REGS;
if ((mode == QImode || mode == HImode)
&& TARGET_SHMEDIA && inqhi_operand (x, mode))
{
sri->icode = ((mode == QImode)
? CODE_FOR_reload_inqi : CODE_FOR_reload_inhi);
return NO_REGS;
}
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
if (TARGET_SHMEDIA && rclass == GENERAL_REGS
sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. gcc/ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete. (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P. (PIC_OFFSET_P): Rename to... (PCREL_SYMOFF_P): ...this. (PIC_DIRECT_ADDR_P): Delete. (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of PIC_OFFSET_P. (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16, UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (print_operand): Remove CONST handling. (unspec_caller_rtx_p): Rewrite to use split_const and check the operands of UNSPEC bases. (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC) with (unspec [A B] UNSPEC_SYMOFF). (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec. (UNSPEC_EXTRACT_U16): Likewise. (UNSPEC_SYMOFF): Likewise. (UNSPEC_PCREL_SYMOFF): Likewise. (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions of constants. (movsi_const_16bit): Likewise. (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise. (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC) with (unspec [A B] UNSPEC_PCREL_SYMOFF). (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B) with (unspec [A B] UNSPEC_SYMOFF). (symPLT_label2reg): Replace (minus A (minus B pc)) with (unspec [A B] PCREL_UNSPEC_SYMOFF). * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16. (Csu): Likewise UNSPEC_EXTRACT_U16. (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P. (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P. From-SVN: r141046
2008-10-10 20:28:25 +02:00
&& (GET_CODE (x) == LABEL_REF || PIC_ADDR_P (x)))
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
return TARGET_REGS;
} /* end of input-only processing. */
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
if (((REGCLASS_HAS_FP_REG (rclass)
&& (REG_P (x)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& (GENERAL_OR_AP_REGISTER_P (REGNO (x))
|| (FP_REGISTER_P (REGNO (x)) && mode == SImode
&& TARGET_FMOVD))))
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
|| (REGCLASS_HAS_GENERAL_REG (rclass)
&& REG_P (x)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& FP_REGISTER_P (REGNO (x))))
&& ! TARGET_SHMEDIA
&& (mode == SFmode || mode == SImode))
return FPUL_REGS;
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
if ((rclass == FPUL_REGS
|| (REGCLASS_HAS_FP_REG (rclass)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& ! TARGET_SHMEDIA && mode == SImode))
&& (MEM_P (x)
|| (REG_P (x)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& (REGNO (x) >= FIRST_PSEUDO_REGISTER
|| REGNO (x) == T_REG
|| system_reg_operand (x, VOIDmode)))))
{
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
if (rclass == FPUL_REGS)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
return GENERAL_REGS;
return FPUL_REGS;
}
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
if ((rclass == TARGET_REGS
|| (TARGET_SHMEDIA && rclass == SIBCALL_REGS))
constraints.md: New file. * config/sh/constraints.md: New file. * config/sh/sh.c: Include tm-constrs.h. (reg_class_from_letter): Remove. (prepare_cbranch_operands): Use satisfies_constraint_* function instead of macro. (andcosts, broken_move, sh_secondary_reload): Likewise. * config/sh/predicates.md (trapping_target_operand): Likewise. (and_operand, arith_operand, arith_reg_or_0_operand, cmp_operand, logical_operand, target_operand, ua_address_operand, ua_offset, xor_operand): Likewise. * config/sh/sh.md: Include constraints.md. (*movsicc_t_false): Use satisfies_constraint_* function instead of macro. (*movsicc_t_true, ashlsi3_std, ashlhi3_k, lshrsi3_m, lshrsi3_k, movsi_const_16bit+2, *movhi_media+1, movdi_const_16bit+1, beq, bne, *ptb): Likewise. * config/sh/sh.h (reg_class_from_letter): Remove prototype. (OVERRIDE_OPTIONS): Don't modify reg_class_from_letter. (REG_CLASS_FROM_CONSTRAINT): Remove. (CONSTRAINT_LEN, CONST_OK_FOR_I20, CONST_OK_FOR_I, CONST_OK_FOR_J, CONST_OK_FOR_K16, CONST_OK_FOR_K, CONST_OK_FOR_P27, CONST_OK_FOR_P, CONST_OK_FOR_M, CONST_OK_FOR_N, CONST_OK_FOR_CONSTRAINT_P, CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. (SECONDARY_INOUT_RELOAD_CLASS): Use satisfies_constraint_* function instead of macro. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (EXTRA_CONSTRAINT_Q, EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc, EXTRA_CONSTRAINT_B, EXTRA_CONSTRAINT_Css, EXTRA_CONSTRAINT_Csu): Remove. (IS_PC_RELATIVE_LOAD_ADDR_P): New macro. (IS_LITERAL_OR_SYMBOLIC_S16_P): Likewise. (IS_LITERAL_OR_SYMBOLIC_U16_P): Likewise. (IS_NON_EXPLICIT_CONSTANT_P): Likewise. (EXTRA_CONSTRAINT_Csy, EXTRA_CONSTRAINT_Z, EXTRA_CONSTRAINT_W, EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C, EXTRA_MEMORY_CONSTRAINT, EXTRA_CONSTRAINT_Sr0, EXTRA_CONSTRAINT_Sua, EXTRA_CONSTRAINT_S, EXTRA_CONSTRAINT_STR): Likewise. (GO_IF_LEGITIMATE_INDEX): Fix indentation. From-SVN: r125561
2007-06-08 08:59:55 +02:00
&& !satisfies_constraint_Csy (x)
&& (!REG_P (x) || ! GENERAL_REGISTER_P (REGNO (x))))
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
return GENERAL_REGS;
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
if ((rclass == MAC_REGS || rclass == PR_REGS)
&& REG_P (x) && ! GENERAL_REGISTER_P (REGNO (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
&& rclass != REGNO_REG_CLASS (REGNO (x)))
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
return GENERAL_REGS;
if (rclass != GENERAL_REGS && REG_P (x)
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
&& TARGET_REGISTER_P (REGNO (x)))
return GENERAL_REGS;
/* If here fall back to loading FPUL register through general registers.
This case can happen when movsi_ie insn is picked initially to
load/store the FPUL register from/to another register, and then the
other register is allocated on the stack. */
if (rclass == FPUL_REGS && true_regnum (x) == -1)
return GENERAL_REGS;
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
/* Force mov.b / mov.w displacement addressing insn to use R0 as
the other operand.
On SH2A could also just leave it alone here, which would result in a
4 byte move insn being generated instead. However, for this to work
the insns must have the appropriate alternatives. */
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode) PR target/50751 * config/sh/sh-protos.h (sh_legitimate_index_p): Add new arguments consider_sh2a and allow_zero. * config/sh/sh.c (sh_legitimate_index_p): Likewise. (disp_addr_displacement): New function. (sh_address_cost): Use disp_addr_displacement function instead of DISP_ADDR_OFFSET. (sh_legitimate_address_p): Adapt to changed sh_legitimate_index_p declaration. (sh_find_mov_disp_adjust): Remove HImode check. (sh_secondary_reload): Add HImode case. Use satisfies_constraint_Sdd, disp_addr_displacement and max_mov_insn_displacement. (max_mov_insn_displacement): Remove HImode check. * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): Remove. * config/sh/constraints.md (K05, K13): New constraints. (K12): Correct comment. (Sdd): Do not use DISP_ADDR_P macro. (Snd, Sbw): Use satisfies_constraint_Sdd. * config/sh/sh.md (extendhisi2): Remove constraints from expander. (*extendhisi2_compact, movhi_i): Remove. (*extendhisi2_compact_reg, *extendhisi2_compact_mem_disp, *extendhisi2_compact_mem_disp, *extendhisi2_compact_snd, *movhi_reg_reg, *movhi_store_mem_disp05, *movhi_store_mem_disp13, *movhi_load_mem_disp, *movhi_load_mem_disp, *movhi): New insns. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_mem_disp, *movqi_store_mem_disp04, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): Use sh_legitimate_index_p instead of CONST_OK_FOR_Kxx. Add new peepholes for HImode displacement addressing. From-SVN: r186311
2012-04-11 13:35:32 +02:00
if ((mode == QImode || mode == HImode) && rclass != R0_REGS
&& satisfies_constraint_Sdd (x)
&& disp_addr_displacement (x) <= max_mov_insn_displacement (mode, false))
return R0_REGS;
/* When reload is trying to address a QImode or HImode subreg on the stack,
force any subreg byte into R0_REGS, as this is going to become a
displacement address.
We could restrict this to SUBREG_BYTE (x) > 0, but if the actual reg
is on the stack, the memref to it might already require a displacement
and that has to be added to the final address. At this point we don't
know the cumulative displacement so we assume the worst case. */
if ((mode == QImode || mode == HImode) && rclass != R0_REGS
&& GET_CODE (x) == SUBREG && true_regnum (x) == -1)
return R0_REGS;
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
return NO_REGS;
}
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
static void
sh_conditional_register_usage (void)
{
int regno;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno ++)
if (! VALID_REGISTER_P (regno))
fixed_regs[regno] = call_used_regs[regno] = 1;
/* R8 and R9 are call-clobbered on SH5, but not on earlier SH ABIs. */
if (TARGET_SH5)
{
call_used_regs[FIRST_GENERAL_REG + 8]
= call_used_regs[FIRST_GENERAL_REG + 9] = 1;
call_really_used_regs[FIRST_GENERAL_REG + 8]
= call_really_used_regs[FIRST_GENERAL_REG + 9] = 1;
}
if (TARGET_SHMEDIA)
{
regno_reg_class[FIRST_GENERAL_REG] = GENERAL_REGS;
CLEAR_HARD_REG_SET (reg_class_contents[FP0_REGS]);
regno_reg_class[FIRST_FP_REG] = FP_REGS;
}
if (flag_pic)
{
fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1;
}
/* Renesas saves and restores mac registers on call. */
if (TARGET_HITACHI && ! TARGET_NOMACSAVE)
{
call_really_used_regs[MACH_REG] = 0;
call_really_used_regs[MACL_REG] = 0;
}
for (regno = FIRST_FP_REG + (TARGET_LITTLE_ENDIAN != 0);
regno <= LAST_FP_REG; regno += 2)
SET_HARD_REG_BIT (reg_class_contents[DF_HI_REGS], regno);
if (TARGET_SHMEDIA)
{
for (regno = FIRST_TARGET_REG; regno <= LAST_TARGET_REG; regno ++)
if (! fixed_regs[regno] && call_really_used_regs[regno])
SET_HARD_REG_BIT (reg_class_contents[SIBCALL_REGS], regno);
}
else
for (regno = FIRST_GENERAL_REG; regno <= LAST_GENERAL_REG; regno++)
if (! fixed_regs[regno] && call_really_used_regs[regno])
SET_HARD_REG_BIT (reg_class_contents[SIBCALL_REGS], regno);
}
target.def (legitimate_constant_p): New hook. gcc/ * target.def (legitimate_constant_p): New hook. * doc/tm.texi.in (LEGITIMATE_CONSTANT_P): Replace with... (TARGET_LEGITIMATE_CONSTANT_P): ...this. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_true): Declare. * hooks.c (hook_bool_mode_rtx_true): Define. * system.h (LEGITIMATE_CONSTANT_P): Poison. * calls.c (precompute_register_parameters): Replace uses of LEGITIMATE_CONSTANT_P with targetm.legitimate_constant_p. (emit_library_call_value_1): Likewise. * expr.c (move_block_to_reg, can_store_by_pieces, emit_move_insn) (compress_float_constant, emit_push_insn, expand_expr_real_1): Likewise. * ira-costs.c (scan_one_insn): Likewise. * recog.c (general_operand, immediate_operand): Likewise. * reload.c (find_reloads_toplev, find_reloads_address_part): Likewise. * reload1.c (init_eliminable_invariants): Likewise. * config/alpha/alpha-protos.h (alpha_legitimate_constant_p): Add a mode argument. * config/alpha/alpha.h (LEGITIMATE_CONSTANT_P): Delete. * config/alpha/alpha.c (alpha_legitimate_constant_p): Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/alpha/predicates.md (input_operand): Update call to alpha_legitimate_constant_p. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Delete. * config/arm/arm.h (ARM_LEGITIMATE_CONSTANT_P): Likewise. (THUMB_LEGITIMATE_CONSTANT_P, LEGITIMATE_CONSTANT_P): Likewise. * config/arm/arm.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (arm_legitimate_constant_p_1, thumb_legitimate_constant_p) (arm_legitimate_constant_p): New functions. (arm_cannot_force_const_mem): Make static. * config/avr/avr.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Delete. * config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin.c (expand_move): Use targetm.legitimate_constant_p instead of bfin_legitimate_constant_p. (bfin_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/cris/cris.h (LEGITIMATE_CONSTANT_P): Delete. * config/fr30/fr30.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_constant_p): Delete. * config/frv/frv.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (frv_legitimate_constant_p): Make static. Add a mode argument. * config/h8300/h8300-protos.h (h8300_legitimate_constant_p): Delete. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/h8300/h8300.c (h8300_legitimate_constant_p): Likewise. * config/i386/i386-protos.h (legitimate_constant_p): Delete. * config/i386/i386.h (LEGITIMATE_CONSTANT_P): Likewise. * config/i386/i386.c (legitimate_constant_p): Rename to... (ix86_legitimate_constant_p): ...this. Make static. Add a mode argument. (ix86_cannot_force_const_mem): Update accordingly. (ix86_legitimate_address_p): Likewise. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/i386/i386.md: Update commentary. * config/ia64/ia64-protos.h (ia64_legitimate_constant_p): Delete. * config/ia64/ia64.h (LEGITIMATE_CONSTANT_P): Likewise. * config/ia64/ia64.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (ia64_legitimate_constant_p): Make static. Add a mode argument. * config/iq2000/iq2000.h (LEGITIMATE_CONSTANT_P): Delete. * config/lm32/lm32-protos.h (lm32_legitimate_constant_p): Delete. * config/lm32/lm32.h (LEGITIMATE_CONSTANT_P): Likewise. * config/lm32/lm32.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (lm32_legitimate_constant_p): Make static. Add a mode argument. * config/m32c/m32c-protos.h (m32c_legitimate_constant_p): Delete. * config/m32c/m32c.h (LEGITIMATE_CONSTANT_P): Likewise. * config/m32c/m32c.c (m32c_legitimate_constant_p): Likewise. * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Delete. * config/m32r/m32r.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (m32r_legitimate_constant_p): New function. * config/m68k/m68k-protos.h (m68k_legitimate_constant_p): Declare. * config/m68k/m68k.h (CONSTANT_ADDRESS_P): Call it instead of LEGITIMATE_CONSTANT_P. (LEGITIMATE_CONSTANT_P): Delete. * config/m68k/m68k.c (m68k_expand_prologue): Call m68k_legitimate_constant_p instead of LEGITIMATE_CONSTANT_P. (m68k_legitimate_constant_p): New function. * config/m68k/m68k.md: Update comments. * config/mcore/mcore.h (LEGITIMATE_CONSTANT_P): Delete. * config/mcore/mcore.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mcore_legitimate_constant_p): New function. * config/mep/mep-protos.h (mep_legitimate_constant_p): Delete. * config/mep/mep.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mep/mep.c (mep_legitimate_constant_p): Make static. Add a mode argument. (mep_legitimate_address): Update accordingly. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/microblaze/microblaze-protos.h (microblaze_const_double_ok): Delete. * config/microblaze/microblaze.h (LEGITIMATE_CONSTANT_P): Likewise. * config/microblaze/microblaze.c (microblaze_const_double_ok): Make static. Check OP's mode for VOIDmode. (microblaze_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Delete. * config/mips/mips.c (mips_legitimate_constant_p): New function. (mips_cannot_force_const_mem): Use it instead of LEGITIMATE_CONSTANT_P. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/predicates.md: Update comments. * config/mmix/mmix-protos.h (mmix_legitimate_constant_p): Delete. * config/mmix/mmix.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mmix/mmix.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mmix_legitimate_constant_p): Make static, return a bool, and take a mode argument. (mmix_print_operand_address): Update accordingly. * config/mn10300/mn10300-protos.h (mn10300_legitimate_constant_p): Delete. * config/mn10300/mn10300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mn10300/mn10300.c (mn10300_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/moxie/moxie.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pa_legitimate_constant_p): New function. * config/picochip/picochip.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pdp11_legitimate_constant_p): New function. * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Delete. * config/rs6000/rs6000.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (rs6000_legitimate_constant_p): New function. * config/rx/rx-protos.h (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. * config/rx/rx.h (LEGITIMATE_CONSTANT_P): Delete. * config/rx/rx.c (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/rx/rx.md (mov<register_modes:mode>): Update accordingly. * config/s390/s390-protos.h (legitimate_constant_p): Delete. * config/s390/s390.h (LEGITIMATE_CONSTANT_P): Likewise. * config/s390/s390.c (legitimate_constant_p): Rename to... (s390_legitimate_constant_p): ...this. Make static, return a bool, and add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/score/score.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (sh_legitimate_constant_p): New function. * config/sparc/sparc-protos.h (legitimate_constant_p): Delete. * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Delete. * config/sparc/sparc.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (legitimate_constant_p): Rename to... (sparc_legitimate_constant_p): ...this. Make static. Add a mode argument. (constant_address_p): Update accordingly. * config/spu/spu-protos.h (spu_legitimate_constant_p): Add a mode argument and return a bool. * config/spu/spu.h (LEGITIMATE_CONSTANT_P): Delete. * config/spu/spu.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (spu_legitimate_constant_p): Add a mode argument and return a bool. (spu_rtx_costs): Update accordingly. * config/spu/predicates.md (vec_imm_operand): Likewise. * config/stormy16/stormy16.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.c (v850_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/vax/vax-protos.h (legitimate_constant_p): Delete. * config/vax/vax.h (LEGITIMATE_CONSTANT_P): Likewise. * config/vax/vax.c (legitimate_constant_p): Likewise. * config/xtensa/xtensa.h (LEGITIMATE_CONSTANT_P): Delete. * config/xtensa/xtensa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (xtensa_legitimate_constant_p): New function. From-SVN: r172814
2011-04-21 11:38:43 +02:00
/* Implement TARGET_LEGITIMATE_CONSTANT_P
can_store_by_pieces constructs VOIDmode CONST_DOUBLEs. */
static bool
sh_legitimate_constant_p (enum machine_mode mode, rtx x)
{
return (TARGET_SHMEDIA
? ((mode != DFmode && GET_MODE_CLASS (mode) != MODE_VECTOR_FLOAT)
|| x == CONST0_RTX (mode)
|| !TARGET_SHMEDIA_FPU
|| TARGET_SHMEDIA64)
: (GET_CODE (x) != CONST_DOUBLE
|| mode == DFmode || mode == SFmode
|| mode == DImode || GET_MODE (x) == VOIDmode));
}
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
re PR target/20695 (sh64-*-* port deos not handle 32 / 64 bit conversions properly) gcc: 2005-05-09 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Don't set flag_finite_math_only if flag_signaling_nans is set. For TARGET_SH2E, if flag_finite_math_only is not set, set IEEE_BIT. * doc/invoke.texi (SH -mieee): Document relation to -ffinite-math-only. 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> Merge of sh-elf specific patches from sh-elf-4_1-branch: 2005-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (ASM_OUTPUT_REG_PUSH): Provide SHMEDIA version. (ASM_OUTPUT_REG_POP): Likewise. 2005-05-05 J"orn Rennecke <joern.rennecke@st.com> Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg and plus_constant. 2005-05-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.c (sh_div_strategy): Initialize with SH_DIV_STRATEGY_DEFAULT. * config/sh/sh.c (SH_DIV_STR_FOR_SIZE): Define. (SH_DIV_STRATEGY_DEFAULT): Likewise. (OPTIMIZATION_OPTIONS): Set sh_div_str to SH_DIV_STR_FOR_SIZE when optimized for size. * config/sh/linux.h (SH_DIV_STRATEGY_DEFAULT): Redefine. (SH_DIV_STR_FOR_SIZE): Likewise. * config/sh/netbsd-elf.h (SH_DIV_STRATEGY_DEFAULT): Likewise. (SH_DIV_STR_FOR_SIZE): Likewise. 2005-05-04 J"orn Rennecke <joern.rennecke@st.com> * config/sh/sh-modes.def (PDImode): Add. * config/sh/sh-protos.h (shmedia_prepare_call_address): Declare. * config/sh/sh.c (print_operand): Handle IF_THEN_ELSE. (target_reg_operand): Allow PDImode. (sh_register_move_cost): If neither sh_gettrcost_str nor TARGET_PT_FIXED is set, assume gettr costs 100. (shmedia_prepare_call_address): New function. (sh_gettrcost_str): Initialize to empty string. (sh_divsi3_libfunc): New variable. * config/sh/sh.h (PT_FIXED_BIT, TARGET_INVALID_SYMBOLS): Define. (TARGET_SWITCH_SH5_32_ANY_EXTRA): Likewise. (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA): Likewise. (TARGET_SWITCHES): Use TARGET_SWITCH_SH5_32_ANY_EXTRA and TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA. (TARGET_OPTIONS): Add -mdivsi3_libfunc. (OVERRIDE_OPTIONS): Set sh_divsi3_libfunc if it hasn't been set by the user. Also set flag_no_function_cse for (TARGET_SHMEDIA && !TARGET_PT_FIXED). (HARD_REGNO_MODE_OK): Allow TARGET_REGS in PDImode. (CONSTRAINT_LEN): Remove debug version. (SECONDARY_INOUT_RELOAD_CLASS:) Break out of (SECONDARY_OUTPUT_RELOAD_CLASS). Use EXTRA_CONSTRAINT_Csy for check if a target register needs a secondary reload through GENERAL_REGS. (SECONDARY_INPUT_RELOAD_CLASS): Use SECONDARY_INOUT_RELOAD_CLASS. (sh_divsi3_libfunc): Declare. (FUNCTION_PROFILER): Provide SHMEDIA version. * config/sh/predicates.md: New file. * config/sh/sh.md (predicates.md): Include. (divsi_inv_call_combine, divsi3): Use sh_divsi3_libfunc. (reload_insi): Fix predicates and constraints. (ptabs): New expander. (*extendsipdi_media, *truncdipdi_media): New insns. (call, call_value, sibcall): Use shmedia_prepare_call_address. * doc/invoke.texi (-multcost, -mdiv): Document new SH options. (-mdivsi3_libfunc, -madjust-unroll, -mindexed-addressing): Likewise. (-mgettrcost, -mpt-fixed, -minvalid-symbols): Likewise. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.c (print_operand): Remove sh_rep_vec extraction. (sh_output_mi_thunk): Make i unsigned. * sh.c (TARGET_ADJUST_UNROLL_MAX): Only redefine if already defined. (sh_adjust_unroll_max): Only define if TARGET_ADJUST_UNROLL_MAX is defined. Update label detection code and iteration lookup, enable basic functionality, but without IV analysis. 2005-04-11 J"orn Rennecke <joern.rennecke@st.com> * sh.h (OPTIMIZATION_OPTIONS): Don't make setting of flag_branch_target_load_optimize dependent on TARGET_SHMEDIA. Set flag_finite_math_only to 2. If flag_finite_math_only set set to 2, set it to 1 iff we use SH2E..SH4 arithmetic without full IEEE support. 2005-04-09 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/lib1funcs.asm (ic_invalidate): Fix typos. * config/sh/t-linux (LIB1ASMFUNCS_CACHE): Add _ic_invalidate_array. 2005-04-06 J"orn Rennecke <joern.rennecke@st.com> Merge of SuperH / STM SH specific patches, including fix for PR target/20695: * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h when building with libgloss. (sh*elf): Implement --without-fp option. (sh64-superh-linux*): Don't multilib. (sh*-*-linux): Use sh3 as basic multilib. * config/sh/crt1.asm (SHmedia start): Add code to enable the MMU, and to set up vbr. Enable FPU before calling set_fpscr. Load atexit address just before use. Use __SH_FPU_ANY__. (SH3*/SH4* start): Add code to set up vbr. Use __SH_FPU_ANY__. Set DN bit in fpscr. * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Merge into: config/sh/sh.h (SH_ASM_SPEC, SUBTARGET_ASM_ISA_SPEC): Here. * config/sh/lib1funcs.asm (HIDDEN_FUNC, HIDDEN_ALIAS): Define. (FMOVD_WORKS): Don't define for __SH5__. (ashiftrt_r4_0, ashiftrt_r4_1, ashiftrt_r4_2, ashiftrt_r4_3): Hide. (ashiftrt_r4_4, ashiftrt_r4_5, ashiftrt_r4_6, ashiftrt_r4_7): Hide. (ashiftrt_r4_8, ashiftrt_r4_9, ashiftrt_r4_10, ashiftrt_r4_11): Hide. (ashiftrt_r4_12, ashiftrt_r4_13, ashiftrt_r4_14, ashiftrt_r4_15): Hide. (ashiftrt_r4_16, ashiftrt_r4_17, ashiftrt_r4_18, ashiftrt_r4_19): Hide. (ashiftrt_r4_20, ashiftrt_r4_21, ashiftrt_r4_22, ashiftrt_r4_23): Hide. (ashiftrt_r4_24, ashiftrt_r4_25, ashiftrt_r4_26, ashiftrt_r4_27): Hide. (ashiftrt_r4_28, ashiftrt_r4_29, ashiftrt_r4_30, ashiftrt_r4_31): Hide. (ashiftrt_r4_32, ashrsi3, ashlsi3, lshrsi3, movmem, movstr): Hide. (movstrSI64, movmemSI64, movstrSI60, movmemSI60): Hide. (movstrSI56, movmemSI56, movstrSI52, movmemSI52): Hide. (movstrSI48, movmemSI48, movstrSI44, movmemSI44): Hide. (movstrSI40, movmemSI40, movstrSI36, movmemSI36): Hide. (movstrSI32, movmemSI32, movstrSI28, movmemSI28): Hide. (movstrSI24, movmemSI24, movstrSI20, movmemSI20): Hide. (movstrSI16,movmemSI16, movstrSI12,movmemSI12): Hide. (movstrSI8,movmemSI8, movstrSI4,movmemSI4): Hide. (movmemSI0, movstrSI0): Remove. (movmemSI4): Schedule last store into rts delay slot. (movmem): Shorten code. Provide ENDFUNC. (movmem_i4_even, movmem_i4_odd, movmemSI12_i4, mulsi3): Hide. (mulsi3): Provide ENDFUNC. (sdivsi3_i4, sdivsi3_i4, udivsi3_i4, udivsi3, set_fpscr): Hide. (SH5 sdivsi3): Reimplement, using: (div_table): New, linear approximation table lookup for division seed. (sdivsi3_2): New SH5 entry point. (divdi3): Use hidden alias for udivdi3. (moddi3): Use hidden alias for umoddi3. (init_trampoline): Hide. Provide exact ENDFUNC. (ic_invalidate): Hide. Re-implement SH4 version, using (ic_invalidate_array): New global. (GCC_shcompact_return_trampoline, GCC_nested_trampoline): Hide. (GCC_push_shmedia_regs_nofpu): Only provide for __SH4_NOFPU__. (GCC_pop_shmedia_regs_nofpu): Likewise. * config/sh/libgcc-excl.ver (__mulsi3): Add. * config/sh/linux.h (TARGET_DEFAULT): Include TARGET_OPT_DEFAULT. * config/sh/sh-protos.h (sh_function_kind): New enum. (sh_gen_truncate, replace_n_hard_rtx): Declare. (function_symbol): Update declaration. (shmedia_cleanup_truncate, sh_contains_memref_p): Declare. * sh.c (cfgloop.h): Include. (TARGET_ADJUST_UNROLL_MAX): Redefine. (print_operand): Add '>' and 'U' support. Handle TRUNCATE and SIGN_EXTEND. (function_sybol): Add arguments for target and kind of symbol. If not an ordinary function symbol, make sure the string becomes unique. For PIC, load appropriately depending on kind of symbol. Changed all callers. (prepare_move_operands): Dont copy R0 to a pseudo for SHmedia. (multcosts): Check sh_multcost_str. If not set, return 2 for SHMEDIA TARGET_SMALLCODE. (sh_rtx_costs): Lower some costs when outer_code is SET. Add code for CONST_VECTOR, MINUS and PARALLEL. (gen_shifty_op): Don't emit nop. (expand_ashiftrt): While expanding to rtl, do shift by 31 using a register set to zero. (gen_datalabel_ref): Make sure that the string is shared. (MAX_POOL_SIZE): Define as 372. (find_barrier): Remove spurious adjustment. (sh_media_register_for_return): Return -1 for interrupt handlers. (sh_pch_valid_p): Use a copy of TARGET_OPTIONS. (general_movsrc_operand): Accept vector that match sh_rep_vec. (general_movdst_operand): For SHmedia, recject paradoxical DImode subregs before high_life / reload. (arith_reg_operand): Allow no-op sign extensions. (logical_reg_operand, fp_arith_reg_dest, xor_operand): New functions. (cmp_operand, shift_operator, logical_operator): Likewise. (minuend_operand, ua_address_operand, cache_address_operand): Likewise. (ua_offset, shift_count_reg_operand, shift_count_operand): Likewise. (sh_adjust_unroll_max, replace_n_hard_rtx, sh_gen_truncate): Likewise. (shmedia_cleanup_truncate, sh_contains_memref_p_1): Likewise. (sh_contains_memref_p): Likewise. (shmedia_6bit_operand): Remove. (arith_operand): Allow some TRUNCATEs. (logical_operand): Disallow subregs <= SImode of >= DImode. (greater_comparison_operator): Fix mode comparison. (less_comparison_operator): Likewise. (target_reg_operand, target_operand): Compare modes with Pmode. (sh_adjust_cost): Consider the dependency between a target register load and its use in a subsequent block. Implement mac_media latency exception. Before reload, anticipate floating point latencies to be at least four. Give preference to the ptabs feeding a casesi_jump_media. Handle UNSPEC in a CALL address. (sh_optimize_target_register_callee_saved): Improve handling of borderline cases. (sh_function_ok_for_sibcall): Allow for non-pic, and also when we will use the symbol with @GOTOFF addressing. (SH_BLTIN_UDI): Remove. (SH_BLTIN_LDUA_L64, SH_BLTIN_LDUA_Q64, SH_BLTIN_STUA_L64): New. (SH_BLTIN_STUA_Q64): Likewise. (signature_args, SH_BLTIN_NUM_SHARED_SIGNATURES): Update. (SH_BLTIN_2, SH_BLTIN_SU, SH_BLTIN_3, SH_BLTIN_SUS): Renumber. (SH_BLTIN_PSSV, SH_BLTIN_XXUU, SH_BLTIN_UUUU, SH_BLTIN_PV): Likewise. (bdesc): Add entries for alloco, mac_media, sqrtdf2, sqrtsf2, fsrra_s, {ld,st}{hi,lo}.[lq] and prefetch. Change mextr entries to use SH_BLTIN_V8QI3. (sh_media_init_builtins): Implement specific TARGET_SHMEDIA32 / TARGET_SHMEDIA64 checks for pointer arguments. (sh_expand_builtin): For pointer types, use ptr_mode / ptr_type_mode. (sh_register_move_cost): Check sh_gettrcost_str. (cmpsi_operand): T_REG is only allowed for TARGET_SH1. (sh_output_mi_thunk): Make static. Check that needed registers are actually available. Make sure that the sibcall won't go via the PLT. (sh_multcost_str, sh_gettrcost_str, sh_div_str): New variables. (cut2_workaround_str, sh_div_strategy, boardtype, osruntime): Likewise. (arith_reg_dest): Allow paradoxical DImode subreg for ! TARGET_SHMEDIA. * sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH_FPU_ANY__ and __SH_FPU_DOUBLE__. (INDEXED_ADDRESS_BIT, ADJUST_UNROLL_BIT, TARGET_DIVIDE_INV): Define. (TARGET_HARVARD): Also true for TARGET_SH5. (TARGET_DIVIDE_FP, TARGET_DIVIDE_INV_FP, TARGET_DIVIDE_CALL2): Define. (TARGET_DIVIDE_INV_MINLAT, TARGET_DIVIDE_INV20U): Define. (TARGET_DIVIDE_INV20L, TARGET_DIVIDE_INV_CALL): Define. (TARGET_DIVIDE_INV_CALL2, TARGET_ALLOW_INDEXED_ADDRESS): Define. (TARGET_ADJUST_UNROLL, TARGET_OPT_DEFAULT, SUBTARGET_OPTIONS): Define. (TARGET_SWITCHES): Removed excessive whitespace. Added options indexed-addressing, no-indexed-addressing, adjust-unroll and no-adjust-unroll. (TARGET_DEFAULT): Add TARGET_OPT_DEFAULT. (TARGET_OPTIONS): Define. (EXTRA_SPECS): Add subtarget_asm_spec. (SH_ASM_SPEC): Pass cut2-workaround option. (SUBTARGET_ASM_ISA_SPEC): Enforce STRICT_NOFPU for SH4 --without-fp. (LINK_EMUL_PREFIX): If target defaults to little endian, default to shl. (OPTIMIZATION_OPTIONS): Set sh_div_str. If not using if not -mieee, set flag_finite_math_only. (sh_divide_strategy_e): New enum. (sh_div_strategy): Declare. (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for TARGET_SHCOMPACT. Clear flag_if_conversion2 for SHMEDIA. Set sh_div_strategy. Leave profile_flag and profile_arc_flag alone. (LOOP_ALIGN): Replace TARGET_HARVARD test with TARGET_HARD_SH4 test. (HARD_REGNO_MODE_OK): Allow TImode in aligned FP registers. (MODES_TIEABLE_P): For TARGET_SHMEDIA, allow tying of integral modes of the same size. (CONST_OK_FOR_I): Fix detection of I06 constraint. (PREFERRED_RELOAD_CLASS): Also choose GENERAL_REGS for PIC_DIRECT_ADDR_P. (SECONDARY_INPUT_RELOAD_CLASS): Fix parentheses. For TARGET_SHMEDIA, check for inqhi_operand, LABEL_REF and PIC_DIRECT_ADDR_P. (FUNCTION_VALUE, PROMOTE_MODE): Don't promote from SImode. For TARGET_SHMEDIA32, promote to SImode. (EXTRA_CONSTRAINT_C16): Allow SIGN_EXTEND to SImode. (DATALABEL_REF_NO_CONST_P: Don't allow SYMBOL_REF. (DATALABEL_REF_P): Don't define. (NON_PIC_REFERENCE_P): Allow LABEL_REF and SYMBOL_REF directly inside a CONST. Don't allow DATALABEL_REF_NO_CONST_P outside of a CONST. Allow a LABEL_REF in a sum. (BASE_REGISTER_RTX_P): Check TRULY_NOOP_TRUNCATION. (INDEX_REGISTER_RTX_P): Likewise. (GO_IF_LEGITIMATE_INDEX): Check if pased the address of an unaligned load / store. (ALLOW_INDEXED_ADDRESS): Define. (GO_IF_LEGITIMATE_ADDRESS): Use it. (TRULY_NOOP_TRUNCATION): Don't allow no-op truncation from 64 bit or beyond to less than 64 bit. (PRINT_OPERAND_PUNCT_VALID_P): Allow '>'. (rtx_equal_function_value_matters): Don't declare. (arith_reg_operand): Allow sign_extend. (PREDICATE_CODES): Allow SIGN_EXTEND in arith_reg_operand. Add any_arith_reg_dest, cache_address_operand, cmp_operand, fp_arith_reg_dest, logical_operator, logical_reg_operand, minuend_operand, shift_count_operand, shift_count_reg_operand, shift_operator, ua_address_operand, ua_offset, unary_float_operator, xor_operand. Don't allow PARALLEL in sh_1el_vec and sh_rep_vec Remove shmedia_6bit_operand. (SPECIAL_MODE_PREDICATES): Add any-arith_reg_dest, target_operand and target_reg_operand. (SIDI_OFF, SIMULTANEOUS_PREFETCHES, high_life_started): Define. (sh_multcost_str, sh_gettrcost_str, sh_div_str): Declare. (cut2_workaround_str): Declare. (INDEX_REG_CLASS): Is NO_REGS if ALLOW_INDEXED_ADDRESS is zero. (LEGITIMIZE_RELOAD_ADDRESS): Check ALLOW_INDEXED_ADDRESS. Substitute INDEX_REG_CLASS with R0_REGS. * sh.md (UNSPEC_DIV_INV_M0, UNSPEC_DIV_INV_M1): New constants. (UNSPEC_DIV_INV_M2, UNSPEC_DIV_INV_M3, UNSPEC_DIV_INV20): Likewise. (UNSPEC_ASHIFTRT, UNSPEC_THUNK): Likewise. (Attribute "length"): jump_media has length 8 if TARGET_SH5_CUT2_WORKAROUND is true. ("highpart"): New attribute. (cmpsi): Allow TARGET_SHMEDIA. (cmpeqsi_media, cmpgtsi_media, cmpgtusi_media): New patterns. (cmpsieqsi_media, cmpsieqdi_media, cmpsigtsi_media): Likewise. (cmpsigtdi_media, cmpsigtusi_media, cmpsigtudi_media): Likewise. (*cmpne0si_media, *cmpne0sisi_media, movdicc_true+1): Likewise. (movdicc_true+2, movsicc_false, movsicc_true): Likewise. (movsicc_true+1, movsicc_true+2, movsicc_true+3): Likewise. (*movsicc_umin, movsicc, movqicc, *adddisi3_media): Likewise. (addsidi3_media, subdisi3_media, mov_neg_si_t): Likewise. (*subsi3_media+1, *subsi3_media+2, divsi3_media_2): Likewise. (divsi_inv_call, *divsi_inv_call_combine, divsi_inv_m0): Likewise. (divsi_inv_m1, divsi_inv_m2, divsi_inv_m3, divsi_inv_m1_3): Likewise. (divsi_inv20, divsi_inv_fp, *divsi_inv_fp_combine, muldi3): Likewise. (*andsi3_media, andcsi3): Likewise. (cmpeqdi_media): Use cmp_operand operand predicate. (*adddi3_media, adddi3z_media): Use arith_reg_dest operand predicate. (adddi3_compact, adddi3_compact+1, addc, addc1): Likewise. (addsi3_media, *addsi3_compact, *subdi3_media): Likewise. (subdi3_compact, subdi3_compact+1, subc, subc1): Likewise. (*subsi3_internal, *subsi3_media, udivsi3_sh2a, divsi3_sh2a): Likewise. (mul_r, mulsidi3_media, mulsidi3_compact): Likewise. (mulsidi3_compact+1, umulsidi3_media, umulsidi3_compact): Likewise. (umulsidi3_compact+1, *andsi3_compact, anddi3, andcdi3): Likewise. (*subsi3_media): Make define_insn_and_split. Use minuend_operand operand predicate. (subsi3): Don't force operand 1 into a register if it is a SUBREG. (udivsi3_i1_media, udivsi3): Use Pmode for function/target address. (divsi3_i1_media, beq_media, *beq_media_i, bne_media): Likewise. (bgt_media, bge_media, bgtu_media, bgeu_media, *bgt_media_i): Likewise. (*blt_media_i, bunordered, jump_media, jump, call_media): Likewise. (call_value_media, call, call_value, sibcall_media, sibcall): Likewise. (indirect_jump, casesi_jump_media, GOTaddr2picreg, *ptb): Likewise. (symGOT_load, casesi, casesi_shift_media, casesi_load_media): Likewise. (return_media_i, return_media): Likewise. (udivsi3_i1_media): Enable also for ! TARGET_DIVIDE_FP. (divsi3_i1_media): Likewise. Don't clobber R2 / R3 / TR1 / TR2. (divsi3): Add support for division by multiplying with inverse. (andsi3): Use logical_reg_operand predicate. Add SHmedia support. (iorsi3): Rename to: (*iorsi3_compact). (xorsi3): Rename to: (*xorsi3_compact). (iorsi3, *iorsi3_media, *logical_sidi3, xorsi3): New patterns. (*logical_sidisi3, *logical_sidi3_2, rotrdi3_mextr+1): Likewise. (ashrsi2_31+2, *ashlsi_c_void, *ashldisi3_media): Likewise. (*lshrdisi3_media, *ashrdisi3_media, ashrdisi3_media_high): Likewise. (ashrdisi3_media_opaque, one_cmpldi2+1, cneg, movsi_const): Likewise. (movsi_const_16bit, *movdi_media_I16, *shori_media_si): Likewise. (*beq_media_i32, *bgt_media_i32, *blt_media_i32): Likewise. (bunordered+1, sibcalli_thunk, ptrel_si, cmpsieqsf_media): Likewise. (cmpsieqdf_media, addv2hi3, ashlv2si3+1, subv2hi3, ldhi_l): Likewise. (ldhi_q, *ldhi_q_comb0, *ldhi_q_comb1, ldlo_l, ldlo_q): Likewise. (*ldlo_q_comb0, *ldlo_q_comb1, sthi_l, sthi_q): Likewise. (*sthi_q_comb0, *sthi_q_comb1, stlo_l, stlo_q): Likewise. (*stlo_q_comb0, *stlo_q_comb1, ldhi_l64, ldhi_q64, ldlo_l64): Likewise. (ldlo_q64, sthi_l64, sthi_q64, stlo_l64, stlo_q64, alloco_i): Likewise. (alloca_i+1): Likewise. (prefetch_media): Inhibit generator function generation. (prefetch_i4): Likewise. Also enable for TARGET_SHCOMPACT. (*iorsi3_compact, iordi3): Use arith_reg_dest operand predicate. (*xorsi3_compact, xordi3, xordi3+1, rotlsi3_1, rotlsi3_31): Likewise. (rotlsi3_16, rotlsi3, *rotlhi3_8, ashlsi3_sh2a, ashlsi3_std): Likewise. (ashlhi3_k, ashlsi3_n, ashlsi3_n+1, ashlsi3_media): Likewise. (*ashlhi3_n, ashlhi3+1, ashrsi3_sh2a, ashrsi3_k, ashrsi2_16): Likewise. (ashrsi2_16+1, ashrsi2_31, ashrsi2_31+1, ashlsi_c): Likewise. (ashrsi3_d, ashrsi3_media, lshrsi3_sh2a, lshrsi3_d): Likewise. (lshrsi3_m, lshrsi3_k, lshrsi3_n, lshrsi3_n, lshrsi3_media): Likewise. (lshrsi3, ashldi3_k, ashldi3_mediai, lshrdi3_k): Likewise. (ashrdi3_k, xtrct_left, xtrct_right, negc, *negdi_media): Likewise. (negsi2, one_cmplsi2, one_cmpldi2, zero_extendsidi2): Likewise. (*zero_extendhisi2_compact, *zero_extendqisi2_compact): Likewise. (zero_extendqihi2, extendhisi2, *extendhisi2_compact): Likewise. (extendqisi2, *extendqisi2_compact, extendqihi2): Likewise. (movsi_const_16bit+1, *movdi_media_I16+1): Likewise. (movdf_media_nofpu+1, movsf_media_nofpu+1, dect, movt, seq): Likewise. (movnegt+1, divsf3_i): Likewise. (xordi3): Use xor_operand operand predicate. (ashlsi3_media): Use shift_count_operand operand predicate. (ashrsi3_media, lshrsi3_media, ashldi3_media, lshrdi3_media): Likewise. (ashrdi3_media): Likewise. (ashrsi2_31+1): Use mov_neg_si_t. (lshrdi3_media, ashrdi3_media): Use ext_dest_operand predicate. Make sure that either the destination is not a subreg, or that the shift generates a sufficient number of sign bit copies. (*loaddi_trunc): Use any_register_operand predicate. (ic_invalidate_line_sh4a): Likewise. (*zero_extendhisi2_media+1): Use simplify_gen_subreg. (*extendhisi2_media+1i, *extendqisi2_media+1): Likewise. (extendsidi2): Add fmov.sl alternative. (load_ra): Add mode for operand 1. (*movsi_media): Discourage the use of floating point registers. Allow TRUNCATE. (*movsi_media_nofpu): Ignore target register alternative for register preferencing. Allow TRUNCATE. (movsi_const_16bit+1): Use gen_movsi_const, and add an REG_EQUAL note. (*movqi_media): Use extend_reg_or_0_operand predicate. (*movdi_media): Ignore target register alternative for register preferencing. Discourage the use of floating point registers. (*movdi_media_nofpu): Ignore target register alternative for register preferencing. (movdi_const_16bit+1): If the source is subregged from SImode, sign-extend highpart. Use ext_dest_operand predicate. (movdi_const_16bit+2, shori_media): Use ext_dest_operand predicate. (reload_outdf+7, reload_outdf+8): Check ALLOW_INDEXED_ADDRESS. (stuff_delay_slot): Add modes for operands 0 and 1. (*beq_media_i, *bgt_media_i): Add '>' to output templates. (*blt_media_i, jump_media): Likewise. (beq, bne): Pass through SImode inputs, and I06 constants. (bgt, blt, ble, bge, bgtu): Pass through SImode inputs, the constant 0. (bltu, bgeu, bleu): Likewise. (GOTaddr2picreg): Don't call gen_datalabel_ref. (ptrel): Rename to: (ptrel_di). (tls_global_dynamic, tls_local_dynamic): Add mode for call. (seq): Properly support input modes other than DImode. (slt, sle, sgt, sge,sne): Properly support SImode. (addsf3_i, negdf2_i, sqrtdf2_i, absdf2_i): Use fp_arith_reg_operand. (mac_media) Enable generator function generation. (fix_truncsfdi2): Use fp_arith_reg_dest operand predicate. (fix_truncdfdi2): Likewise. (movv8qi_i+3): Enable for CONST0_RTX too. (movv2hi_i): Use add.l, not addz.l. (ashlv2si3, ashlv4hi3, lshrv2si3): Use shift_count_reg_operand. (lshrv4hi3): Likewise. (ussubv8qi3): Allow zero for operand 1. (prefetch): Allow any mode for operand 0. Enable for SHCOMPACT. Use force_reg. * config/sh/shmedia.md: (shmedia): Remove automaton declaration. (sh5inst_pipe, sh5fpu_pipe): New automatons. (sh5issue): Use sh5inst_pipe. (sh5fds): Use sh5fpu_pipe. (shmedia_fdiv, shmedia_dfdiv): Also use sh5issue. * config/sh/sshmedia.h (sh_media_GETCON, sh_media_PUTCON): Declare with always_inline Attribute. * t-sh64 (LIB1ASMFUNCS): Add _div_table. * config/sh/ushmedia.h (sh_media_MABS_L): Use builtin function. (sh_media_MABS_W, sh_media_MADD_L, sh_media_MADD_W): Likewise. (sh_media_MADDS_L, sh_media_MADDS_UB, sh_media_MADDS_W): Likewise. (sh_media_MCMPEQ_B, sh_media_MCMPEQ_L, sh_media_MCMPEQ_W): Likewise. (sh_media_MCMPGT_UB, sh_media_MCMPGT_L, sh_media_MCMPGT_W): Likewise. (sh_media_MCMV, sh_media_MCNVS_LW, sh_media_MCNVS_WB): Likewise. (sh_media_MCNVS_WUB, sh_media_MEXTR1, sh_media_MEXTR2): Likewise. (sh_media_MEXTR3, sh_media_MEXTR4, sh_media_MEXTR5): Likewise. (sh_media_MEXTR6, sh_media_MEXTR7, sh_media_MMACFX_WL): Likewise. (sh_media_MMACNFX_WL, sh_media_MMUL_L, sh_media_MMUL_W): Likewise. (sh_media_MMULFX_L, sh_media_MMULFX_W, sh_media_MMULFXRP_W): Likewise. (sh_media_MMULHI_WL, sh_media_MMULLO_WL): Likewise. (sh_media_MMULSUM_WQ, sh_media_MPERM_W, sh_media_MSAD_UBQ): Likewise. (sh_media_MSHALDS_L, sh_media_MSHALDS_W, sh_media_MSHARD_L): Likewise. (sh_media_MSHARD_W, sh_media_MSHARDS_Q, sh_media_MSHFHI_B): Likewise. (sh_media_MSHFHI_L, sh_media_MSHFHI_W, sh_media_MSHFLO_B): Likewise. (sh_media_MSHFLO_L, sh_media_MSHFLO_W, sh_media_MSHLLD_L): Likewise. (sh_media_MSHLLD_W, sh_media_MSHLRD_L, sh_media_MSHLRD_W): Likewise. (sh_media_MSUB_L, sh_media_MSUB_W, sh_media_MSUBS_L): Likewise. (sh_media_MSUBS_UB, sh_media_MSUBS_W, sh_media_FABS_D): Likewise. (sh_media_FABS_S, sh_media_FCMPUN_D, sh_media_FCMPUN_S): Likewise. (sh_media_FIPR_S, sh_media_FMAC_S, sh_media_FSQRT_D): Likewise. (sh_media_FSQRT_S, sh_media_FTRV_S, sh_media_LDHI_L): Likewise. (sh_media_LDHI_Q, sh_media_LDLO_L, sh_media_LDLO_Q): Likewise. (sh_media_STHI_L, sh_media_STHI_Q, sh_media_STLO_L): Likewise. (sh_media_STLO_Q, sh_media_NSB, sh_media_BYTEREV): Likewise. (sh_media_PREFO, sh_media_ALLOCO): Likewise. (sh_media_FCOSA_S, sh_media_FSINA_S): New function. (sh_media_FMOV_DQ, sh_media_FMOV_LS): Use union assignment. (sh_media_FMOV_QD, sh_media_FMOV_SL): Likewise. (sh_media_CMVEQ): Use C code. Add attribute always_inline. (sh_media_CMVNE): Likewise. (sh_media_ADDZ_L): Use C code. (sh_media_unaligned_LD_L): Use intrinsics directly. (sh_media_unaligned_LD_Q, sh_media_unaligned_ST_L): Likewise. (sh_media_unaligned_ST_Q): Likewise. * config/sh/divtab.c: New file. 2005-04-06 Andrew Stubbs <andrew.stubbs@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * config/sh/superh64.h, config/sh/superh.h: New files. * config/sh/newlib.h, config/sh/t-superh: Likewise. * config.gcc: Add support for sh*-superh-elf* and sh64-superh-linux*. gcc/testsuite: 2005-05-06 J"orn Rennecke <joern.rennecke@st.com> * gcc.dg/pr15784-3.c: Add -fno-finite-math-only option. * gcc.dg/20021029-1.c: For sh64*-*-*, add -mpt-fixed. From-SVN: r99460
2005-05-09 19:42:55 +02:00
enum sh_divide_strategy_e sh_div_strategy = SH_DIV_STRATEGY_DEFAULT;
static void
sh_init_sync_libfuncs (void)
{
init_sync_libfuncs (UNITS_PER_WORD);
}
/* Return true if it is appropriate to emit `ret' instructions in the
body of a function. */
bool
sh_can_use_simple_return_p (void)
{
HARD_REG_SET live_regs_mask;
int d;
/* Some targets require special return insns. */
if (TARGET_SHMEDIA
|| (TARGET_SHCOMPACT
&& (crtl->args.info.call_cookie & CALL_COOKIE_RET_TRAMP (1))))
return false;
if (! reload_completed || frame_pointer_needed)
return false;
/* Moving prologue around does't reduce the size. */
if (optimize_function_for_size_p (cfun))
return false;
/* Can't optimize CROSSING_JUMPS for now. */
if (flag_reorder_blocks_and_partition)
return false;
/* Finally, allow for pr save. */
d = calc_live_regs (&live_regs_mask);
if (rounded_frame_size (d) > 4)
return false;
return true;
}
/*------------------------------------------------------------------------------
Address mode optimization support code
*/
typedef HOST_WIDE_INT disp_t;
static const disp_t MIN_DISP = HOST_WIDE_INT_MIN;
static const disp_t MAX_DISP = HOST_WIDE_INT_MAX;
static const disp_t INVALID_DISP = MAX_DISP;
/* A memory reference which is described by a base register and a
displacement. */
class base_reg_disp
{
public:
base_reg_disp (rtx br, disp_t d);
bool is_reg (void) const;
bool is_disp (void) const;
rtx reg (void) const;
disp_t disp (void) const;
private:
rtx reg_;
disp_t disp_;
};
inline
base_reg_disp::base_reg_disp (rtx br, disp_t d)
: reg_ (br), disp_ (d)
{
}
inline bool
base_reg_disp::is_reg (void) const
{
return reg_ != NULL_RTX && disp_ != INVALID_DISP;
}
inline bool
base_reg_disp::is_disp (void) const
{
return reg_ == NULL_RTX && disp_ != INVALID_DISP;
}
inline rtx
base_reg_disp::reg (void) const
{
return reg_;
}
inline disp_t
base_reg_disp::disp (void) const
{
return disp_;
}
/* Find the base register and calculate the displacement for a given
address rtx 'x'.
This is done by walking the insn list backwards and following SET insns
that set the value of the specified reg 'x'. */
static base_reg_disp
sh_find_base_reg_disp (rtx insn, rtx x, disp_t disp = 0, rtx base_reg = NULL)
{
if (REG_P (x))
{
if (REGNO (x) == GBR_REG)
return base_reg_disp (x, disp);
/* We've reached a hard-reg. This is probably the point where
function args are copied to pseudos. Do not go any further and
stick to the pseudo. If the original mem addr was in a hard reg
from the beginning, it will become the base reg. */
if (REGNO (x) < FIRST_PSEUDO_REGISTER)
return base_reg_disp (base_reg != NULL ? base_reg : x, disp);
/* Try to find the previous insn that sets the reg. */
for (rtx i = prev_nonnote_insn (insn); i != NULL;
i = prev_nonnote_insn (i))
{
if (REGNO_REG_SET_P (regs_invalidated_by_call_regset, GBR_REG)
&& CALL_P (i))
break;
if (!NONJUMP_INSN_P (i))
continue;
rtx p = PATTERN (i);
if (p != NULL && GET_CODE (p) == SET && REG_P (XEXP (p, 0))
&& REGNO (XEXP (p, 0)) == REGNO (x))
{
/* If the recursion can't find out any more details about the
source of the set, then this reg becomes our new base reg. */
return sh_find_base_reg_disp (i, XEXP (p, 1), disp, XEXP (p, 0));
}
}
/* When here, no previous insn was found that sets the reg.
The input reg is already the base reg. */
return base_reg_disp (x, disp);
}
else if (GET_CODE (x) == PLUS)
{
base_reg_disp left_val = sh_find_base_reg_disp (insn, XEXP (x, 0));
base_reg_disp right_val = sh_find_base_reg_disp (insn, XEXP (x, 1));
/* Either left or right val must be a reg.
We don't handle the case of 'reg + reg' here. */
if (left_val.is_reg () && right_val.is_disp ())
return base_reg_disp (left_val.reg (), left_val.disp ()
+ right_val.disp () + disp);
else if (right_val.is_reg () && left_val.is_disp ())
return base_reg_disp (right_val.reg (), right_val.disp ()
+ left_val.disp () + disp);
else
return base_reg_disp (base_reg, disp);
}
else if (CONST_INT_P (x))
return base_reg_disp (NULL, disp + INTVAL (x));
/* Didn't find anything useful. */
return base_reg_disp (base_reg, disp);
}
/* Given an insn and a memory operand, try to find an equivalent GBR
based memory address and return the corresponding new memory address.
Return NULL_RTX if not found. */
rtx
sh_find_equiv_gbr_addr (rtx insn, rtx mem)
{
if (!MEM_P (mem))
return NULL_RTX;
/* Leave post/pre inc/dec or any other side effect addresses alone. */
if (side_effects_p (XEXP (mem, 0)))
return NULL_RTX;
base_reg_disp gbr_disp = sh_find_base_reg_disp (insn, XEXP (mem, 0));
if (gbr_disp.is_reg () && REGNO (gbr_disp.reg ()) == GBR_REG)
{
rtx disp = GEN_INT (gbr_disp.disp ());
if (gbr_displacement (disp, GET_MODE (mem)))
return gen_rtx_PLUS (SImode, gen_rtx_REG (SImode, GBR_REG), disp);
}
return NULL_RTX;
}
/*------------------------------------------------------------------------------
Manual insn combine support code.
*/
/* Given a reg rtx and a start insn, try to find the insn that sets the
specified reg by using the specified insn stepping function, such as
'prev_nonnote_insn_bb'. When the insn is found, try to extract the rtx
of the reg set. */
set_of_reg
sh_find_set_of_reg (rtx reg, rtx insn, rtx(*stepfunc)(rtx))
{
set_of_reg result;
result.insn = insn;
result.set_rtx = NULL_RTX;
result.set_src = NULL_RTX;
if (!REG_P (reg) || insn == NULL_RTX)
return result;
for (result.insn = stepfunc (insn); result.insn != NULL_RTX;
result.insn = stepfunc (result.insn))
{
if (LABEL_P (result.insn) || BARRIER_P (result.insn))
return result;
if (!NONJUMP_INSN_P (result.insn))
continue;
if (reg_set_p (reg, result.insn))
{
result.set_rtx = set_of (reg, result.insn);
if (result.set_rtx == NULL_RTX || GET_CODE (result.set_rtx) != SET)
return result;
result.set_src = XEXP (result.set_rtx, 1);
return result;
}
}
return result;
}
/* Given an op rtx and an insn, try to find out whether the result of the
specified op consists only of logical operations on T bit stores. */
bool
sh_is_logical_t_store_expr (rtx op, rtx insn)
{
if (!logical_operator (op, SImode))
return false;
rtx ops[2] = { XEXP (op, 0), XEXP (op, 1) };
int op_is_t_count = 0;
for (int i = 0; i < 2; ++i)
{
if (t_reg_operand (ops[i], VOIDmode)
|| negt_reg_operand (ops[i], VOIDmode))
op_is_t_count++;
else
{
set_of_reg op_set = sh_find_set_of_reg (ops[i], insn,
prev_nonnote_insn_bb);
if (op_set.set_src == NULL_RTX)
continue;
if (t_reg_operand (op_set.set_src, VOIDmode)
|| negt_reg_operand (op_set.set_src, VOIDmode)
|| sh_is_logical_t_store_expr (op_set.set_src, op_set.insn))
op_is_t_count++;
}
}
return op_is_t_count == 2;
}
/* Given the operand that is extended in a sign/zero extend insn, and the
insn, try to figure out whether the sign/zero extension can be replaced
by a simple reg-reg copy. If so, the replacement reg rtx is returned,
NULL_RTX otherwise. */
rtx
sh_try_omit_signzero_extend (rtx extended_op, rtx insn)
{
if (REG_P (extended_op))
extended_op = extended_op;
else if (GET_CODE (extended_op) == SUBREG && REG_P (SUBREG_REG (extended_op)))
extended_op = SUBREG_REG (extended_op);
else
return NULL_RTX;
/* Reg moves must be of the same mode. */
if (GET_MODE (extended_op) != SImode)
return NULL_RTX;
set_of_reg s = sh_find_set_of_reg (extended_op, insn, prev_nonnote_insn_bb);
if (s.set_src == NULL_RTX)
return NULL_RTX;
if (t_reg_operand (s.set_src, VOIDmode)
|| negt_reg_operand (s.set_src, VOIDmode))
return extended_op;
/* If the zero extended reg was formed by a logical operation, check the
operands of the logical operation. If both originated from T bit
stores the zero extension can be eliminated. */
else if (sh_is_logical_t_store_expr (s.set_src, s.insn))
return extended_op;
return NULL_RTX;
}
#include "gt-sh.h"